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.

Liferay Portal Security AuditCos'è e come funzione il framework di Security Audit

Vi siete mai chiesti cos'è e come funziona il sistema di Security Audit di Liferay? Ho cercato di rispondere alla domanda non soffermandomi solo al "cosè e come funziona", sono andato ben oltre. Non vi resta che leggere questo EBook per scoprire.

Ottieni il tuo EBook

Antonio Musarra

I began my journey into the world of computing from an Olivetti M24 PC ( 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...

Liferay SSL/TLS SecurityCome configurare il bundle Liferay per abilitare il protocollo SSL/TLS

Sei curioso di scoprire come configurare il bundle Liferay per funzionare in modalità sicura tramite protocollo SSL/TLS? In questo eBook ( #LFRDEPGUIDE ) ti spiego come farlo step-by-step; per il bundle Apache Tomcat e WildFly. Ricorda di lasciare un tuo feedback dopo averlo letto.