Errors
Introduction
The OOCAR API always respond to request with a 200 code. If an error is handled, it will be returned with an error argument.
All responses with a code different from 200 are server problems (these are very rare).
Handled error
Error object
Variable
Type
message
String
type
String
name
String
code
Number
data
Any
optionnal
Example :
{
error: {
message: 'The request could not be found.',
type: 'RequestException',
name: 'NotFoundRequest',
code: 204
}
}Exceptions
AuthException
AuthExceptionThis exception is handled when an error occured in the authentication
Available Exceptions :
InvalidLoginCredentialsmessage: The provided login credantials are invalid.code: 100
NoTokenProvidedmessage: No token provided.code: 101
InvalidTokenmessage: The provided token is invalid.code: 102
ForbiddenNodeAccessmessage: The requested node access is forbidden.code: 103
ForbiddenRequestmessage: The request is forbidden.code: 104
ExpiredTokenmessage: The provided token is expired.code: 105
NotGrantedPermissionsmessage: The required permissions have not been granted.code: 106
RequestException
RequestExceptionThis exception is handled when an error occured in the request
Available Exceptions :
NotFoundNodemessage: The requested node could not be found.code: 200
InvalidQueryDatamessage: Some query data are invalid.code: 201
InvalidBodyDatamessage: Some body data are invalid.code: 202
InvalidRequestmessage: The request is invalid.code: 203
NotFoundRequestmessage: The request could not be found.code: 204
UnknownException
UnknownExceptionThis exception is handled when an unknown error occurred on the server.
Last updated
Was this helpful?