Backendless Support
 
Answered

can we create custom errors?

HI,

We would like to edit the error produced by Backendless when a User already exists. Currently the default message is "Unable to register user. User already exists.". I have two related questions (1) can we change this message on the back endless website or do we have to do it in our applications code? (2) do you have associated error codes with each error and how do we check them?

Thanks,

Feras A.

Best Answer
photo

Hi,

When backendless reports an error - it's delivered via an instance of BackendlessFault class. The message, code and some other info which is being delivered can be accessed by the corresponding methods, such as:

  1. public String getCode();
  2. public String getMessage();
  3. public String getDetail();
  4. public String toString();

But unfortunately you can't edit them. More details you my find in the documentation. At the end of the page there's a complete list of error messages. You can catch them and wrap into your own, but you'll have to implement it by yourself.

Best Regards

Leave a Comment

Comments (1)

photo
2

Hi,

When backendless reports an error - it's delivered via an instance of BackendlessFault class. The message, code and some other info which is being delivered can be accessed by the corresponding methods, such as:

  1. public String getCode();
  2. public String getMessage();
  3. public String getDetail();
  4. public String toString();

But unfortunately you can't edit them. More details you my find in the documentation. At the end of the page there's a complete list of error messages. You can catch them and wrap into your own, but you'll have to implement it by yourself.

Best Regards