SugarREST API returns a entry_list even when the record is not found

Calling the REST API get_entry for a record that does not exist, I would expect that the service returns a fault instead of a entry_list. See example shown below:

Source 1. JSON returned when th record is not found.

My proposal is that the service returns a fault when the event occurs: records not found. See the example of the desired fault follows.

Source 2. Desired fault when record not found or deleted.

Managing abnormal situations through fault messages, simplifies error handling client side. See the output of a Java client Rest in case of error in the login process.

SugarCRM Login Fault

Figure 1. SugarCRM Login Fault

Figure 2. Get Entry Fault when Module does not exist

Figure 2. Get Entry Fault when Module does not exist

Following is an example of Java code that implements a client Rest managing all the fault the same way.

Source 3. Example of Java code that handles situations Fault.

The reference version is the 6.1 Community Edition, version 3 of the REST API.

0 Condivisioni

Antonio Musarra

I began my journey into the world of computing from an Olivetti M24 PC (http://it.wikipedia.org/wiki/Olivetti_M24) bought by my father for his work. Day after day, quickly taking control until … Now doing business consulting for projects in the enterprise application development using web-oriented technologies such as J2EE, Web Services, ESB, TIBCO, PHP.

Potrebbero interessarti anche...