You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
extractError: functionextractError(resp){varerror={};varhttpResponse=resp.httpResponse;if(httpResponse.body.length>0){vare=JSON.parse(httpResponse.body.toString());if(e.__type||e.code||e.Code){error.code=(e.__type||e.code||e.Code).split('#').pop();}else{error.code='UnknownError';}if(error.code==='RequestEntityTooLarge'){error.message='Request body must be less than 1 MB';}else{error.message=(e.message||e.Message||null);}}else{error.code=httpResponse.statusCode;error.message=null;}resp.error=ALY.util.error(newError(),error);},
而有的错误不是 code 或 Code,而是 errorCode,如 SLS 接口的错误:
{"errorCode":"ParameterInvalid","errorMessage":"ErrorType:ColumnNotExists.ErrorPosition,line:1633886764,column:1.ErrorMessage:line 1:109: Column 'count' cannot be resolved;please add the column in the index attribute"}
这就导致了,该错误不会展示给用户,而是 SDK 抛出 UnknownError 异常。
The text was updated successfully, but these errors were encountered:
lib/service_interface/json.js
里面的extractError
方法会导致一些错误,无法展示给用户。源码:
而有的错误不是
code
或Code
,而是errorCode
,如 SLS 接口的错误:这就导致了,该错误不会展示给用户,而是 SDK 抛出
UnknownError
异常。The text was updated successfully, but these errors were encountered: