The best way to handle errors from a service is to use service defined events and invoke actions. A service has three events (select service in Design view, open Events tab):
Note: both Error and Success events will never be called in the same request. Under the hood, these events are invoked via these jQuery functions and their arguments which you may use: onComplete': function(jqXHR, textStatus) {}onSuccess': function(data) {}onError': function(jqXHR, textStatus, errorThrown) {}For example, to notify user of an error, the following could be used: [Error event/Run Custom JavaScript action]: alert ('There was a problem with the service.');// do more here...show error in the screen![]() |
