Closed jacomyal closed 11 years ago
Instead of hooks modifying the data, I just implemented the expect
feature for the services. It makes possible to intercept calls that return a 200 response, and redirect them to their respective error
callback, depending on the data, the parameters given to the service and the related service definition.
It is possible to set expect
in the service definition, while calling the service, in the instance settings or even in the global settings.
Would be nice to make it possible to catch services for one instance or globally. Here is an example (with
d
a domino instance):Then, when a service returns a
data
object wheredata.result !== 'Ok'
, the relatederror
callback will be triggered instead of thesuccess
callback, with the error message'rpc'
.