Error Handling¶
When the server reports an error, it is delivered to the client through a fault object, which is an untyped JavaScript object. The fault object has the same structure for both blocking and non-blocking invocations:
{
"message": value,
"statusCode": value
}
where:
Argument | Description |
---|---|
message |
contains a string value with the description of the error |
statusCode |
error code as a string value. Currently all the error codes are numbers, however the method returning the error code returns the String type. This is done for future expansion of the error code system which may include characters. |
The asynchronous calls receive the fault through the catch()
function of the returned promise object.
nonBlockingBackendlessAPICall()
.then( function() {
})
.catch( function( error ) {
console.log("error message - " + err.message);
console.log("error code - " + err.statusCode);
});
Error Codes¶
Click here for the complete list of Backendless Error Codes