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
AuthException
This exception is handled when an error occured in the authentication
Available Exceptions :
InvalidLoginCredentials
message
: The provided login credantials are invalid.code
: 100
NoTokenProvided
message
: No token provided.code
: 101
InvalidToken
message
: The provided token is invalid.code
: 102
ForbiddenNodeAccess
message
: The requested node access is forbidden.code
: 103
ForbiddenRequest
message
: The request is forbidden.code
: 104
ExpiredToken
message
: The provided token is expired.code
: 105
NotGrantedPermissions
message
: The required permissions have not been granted.code
: 106
RequestException
RequestException
This exception is handled when an error occured in the request
Available Exceptions :
NotFoundNode
message
: The requested node could not be found.code
: 200
InvalidQueryData
message
: Some query data are invalid.code
: 201
InvalidBodyData
message
: Some body data are invalid.code
: 202
InvalidRequest
message
: The request is invalid.code
: 203
NotFoundRequest
message
: The request could not be found.code
: 204
UnknownException
UnknownException
This exception is handled when an unknown error occurred on the server.
Last updated
Was this helpful?