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
When handling errors, e.g. try {... } catch (error) { ... }, I couldn't find a definitive source of the definition of the error object. What I've done is log out the error object and added it below with my own interpretation of the object fields and what each of them means. Happy to submit a PR to update the README docs.
{
// The error type, possible values are RequestError, StatusCodeError, TransformError
"name": "StatusCodeError",
// A formatted string
"message": "{statusCode} - JSON.stringify(response.body)",
// The full stack trace captured a the point the error is generated
"stack": "Full stack trace",
// The HTTP status code
"statusCode": 404,
// The response body (legacy?)
"error": "",
// The option object pass into the request
"options": {},
// The response object
"response": {}
}
{
// The error type, possible values are RequestError, StatusCodeError, TransformError
"name": "RequestError",
// The stringify value of the upstream error object
"message": "cause",
// The upstream error object
"cause": "cause",
// The same as the cause value (legacy?)
"error": "cause",
// The option object pass into the request
"options": {},
// The response object
"response": {}
}
{
// The error type, possible values are RequestError, StatusCodeError, TransformError
"name": "TransformError",
// The stringify value of the upstream error object
"message": "cause",
// The upstream error object
"cause": "cause",
// The same as the cause value (legacy?)
"error": "cause",
// The option object pass into the request
"options": {},
// The response object
"response": {}
}
The text was updated successfully, but these errors were encountered:
When handling errors, e.g.
try {... } catch (error) { ... }
, I couldn't find a definitive source of the definition of the error object. What I've done is log out the error object and added it below with my own interpretation of the object fields and what each of them means. Happy to submit a PR to update theREADME
docs.The text was updated successfully, but these errors were encountered: