For a general view of the errors returned by the API consult the official documentation.
All errors returned by the API are handled by the SDK and for each there is an appropriate error class.
Every error class extends the BaseError class which is based on StandardError.
Example of an error thrown by the SDK:
NotFoundError: not_found {
status: 404,
headers: {
'Content-Type': 'application/json'
},
body: {
message: 'Not found',
code: 'not_found'
}
}When a request returns with an HTTP status code of 403.
When a request returns with an HTTP status code of 500.
When a request returns with an HTTP status code of 400 and the response's body contains an error value of invalid_scope.
Returned when a request that requires authentication is performed without the proper credentials.
When a request returns with an HTTP status code of 404.
Returned for a request whose response contains an OTP-TOKEN header value of REQUIRED.
When a request returns with an HTTP status code of 429.
When a request returns with an HTTP status code of 400 and the response's body contains an error value of invalid_request or invalid_grant.
When a request returns with an HTTP status code of 401 and the response's body contains an error value of invalid_token.
When a request returns with an HTTP status code equal to or lower than 0 (browser only).
Returned as a fallback when the error is not any of the other ones herein described.
Returned for a request whose body contains a validation_failed code.