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.

circle-exclamation

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

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

circle-info

NotGrantedPermissions exception have a data argument that report the ungranted permissions.

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

circle-info

InvalidQueryData and InvalidBodyData exceptions have a data argument that report the invalid data.

circle-info

InvalidRequest can have a different message argument according situations.

UnknownException

This exception is handled when an unknown error occurred on the server.

Last updated

Was this helpful?