Usually, errors come from the Hybrid Web Container or from the back-end server side.
For online requests, when the error comes from the Hybrid Web Container, handle it in the errorCallback function, for example:
department_create_onlineRequest(dep1, "", function(errorMessage ) { //TODO: error occurred... } );
An error message passed as an incoming Hybrid App message in the user-defined function of processDataMessage is another type of error that comes from the back-end server. The incomingDataMessageValue should be similar to this:
<M><H><S>...<S/> ..<V k=”ErrorLogMessage” t=”T”>ERROR:......</V><V k=ErrorLogMessageAsList> ....</V>..</M> hwc.processDataMessage = function processDataMessage (incomingDataMessageValue, noUI, loading, fromActivationFlow, dataType) { //// var workflowMessage = new WorkflowMessage(incomingWorkflowMessage); //if ( workflowMessage.getRequestAction() == Customer.findByPrimaryKeyAction ){ // var detailErrorMsg = workflowMessage.getValues().getData(“ErrorLogMessage”).getValue(); // } }