AnsweredAssumed Answered

How to create custom JSON error messages?

Question asked by Milan Milan on Dec 1, 2014
Latest reply on Dec 1, 2014 by Norbert Groene
Hello,

I am intercepting SugarCRM JSON data in the middle as proxy between client and server and sometimes I would like to return custom error message to the client on some operations.

So far I have discovered those 2 standard formats for SugarCRM JSON error messages:

{"error":"need_login","error_message":"You must specify a valid username and password."}

{"error":"not_found","error_message":"Could not find record: d4d47050-e194-f93e-3bc3-547729eecbfc in module: Accounts"}

Where can I find all SugarCRM error message codes listed? Any tip for error handling in SugarCRM/JSON is welcome.

P.S. Btw, the problem with second (from above) error message is that error text that was returned from server is not displayed but some other text is displayed ("error during communication with server...").

Outcomes