You should always call both load
and detect
with a .catch
function where you should handle possible errors, e.g.
botdPromise
.then(botd => botd.detect())
.then(result => {
console.log(result);
})
.catch(err => console.error(err))
Successful server API response has status code
200 Ok
The description of the server API error will be contained in the response body. The error format can be found below
The error message has the following structure:
{
"error": {
"code": "publicKeyInvalid",
"message": "publicKey not found"
}
}
code
- error code, e.g. publicKeyInvalid
.
message
- error description.
Error code | HTTP Status Code | Description |
---|---|---|
publicKeyRequired | 401 Unauthorized | PublicKey specified incorrectly |
publicKeyInvalid | 401 Unauthorized | PublicKey not found |
secretKeyRequired | 401 Unauthorized | SecretKey specified incorrectly |
secretKeyInvalid | 401 Unauthorized | SecretKey not found |
requestCannotBeParsed | 400 Bad request | Error during body parsing |
badRequest | 400 Bad request | Error in the request, details in message |
tooManyRequests | 429 Too many request | Request limit exceeded |
botdApiFailed | 500 Internal Server Error | Other errors |