来自 Yodlee REST 聚合的异常和错误的格式 API
Format for exceptions and errors from Yodlee REST Aggregation API
在对 Yodlee REST 聚合 API 进行的 API 调用的响应负载中捕获异常的最佳方法是什么?
历史上我见过 {'Error' => [{'errorDetail' => 'some error message'}]}
,但我也见过 {'errorOccured' => true, 'exceptionType' => 'some documented exception type', 'referenceCode' => ''}
。
documentation 表明我可以期待 exceptionType,但我想确定一下。我目前最关心的 API 调用是 /login.
以下是您可以预期的错误代码格式类型-
JSON 异常格式 1:
{
"errorOccurred": "true",
"exceptionType": "com.yodlee.core.SiteNotFoundException",
"referenceCode": "_afe4ae60-68fe-4443-a721-d97a192e9455",
"message": "Argument value not found: 164413432"
}
JSON 异常格式 2(与格式 1 相同,但缺少 "message" 属性,因此被视为附加属性):
{
"errorOccurred": "true",
"exceptionType": "Exception Occurred",
"referenceCode":“_5c4d1347-cb4a-4404-809b-57dbfabcf1db”
}
JSON 异常格式 3:
{
"Error": [
{
"errorDetail": "No session ID found "
}
]
}
JSON 异常格式 4(与格式 3 相同,但缺少 "errorDetail" 属性,因此被视为附加属性):
{
"Error": [
无效的
]
}
JSON 异常格式 5:
{
"errorDetail": "Token authentication failed for cobrand/user Invalid cobrand conversation credentials"
}
这将涵盖几乎所有场景。
在对 Yodlee REST 聚合 API 进行的 API 调用的响应负载中捕获异常的最佳方法是什么?
历史上我见过 {'Error' => [{'errorDetail' => 'some error message'}]}
,但我也见过 {'errorOccured' => true, 'exceptionType' => 'some documented exception type', 'referenceCode' => ''}
。
documentation 表明我可以期待 exceptionType,但我想确定一下。我目前最关心的 API 调用是 /login.
以下是您可以预期的错误代码格式类型-
JSON 异常格式 1: { "errorOccurred": "true", "exceptionType": "com.yodlee.core.SiteNotFoundException", "referenceCode": "_afe4ae60-68fe-4443-a721-d97a192e9455", "message": "Argument value not found: 164413432" }
JSON 异常格式 2(与格式 1 相同,但缺少 "message" 属性,因此被视为附加属性): { "errorOccurred": "true", "exceptionType": "Exception Occurred", "referenceCode":“_5c4d1347-cb4a-4404-809b-57dbfabcf1db” }
JSON 异常格式 3: { "Error": [ { "errorDetail": "No session ID found " } ] }
JSON 异常格式 4(与格式 3 相同,但缺少 "errorDetail" 属性,因此被视为附加属性): { "Error": [ 无效的 ] }
JSON 异常格式 5: { "errorDetail": "Token authentication failed for cobrand/user Invalid cobrand conversation credentials" }
这将涵盖几乎所有场景。