Can someone suggest me a way (if any) to intercept the server response when requesting a CRUD action using can-connect/can/super-map/super-map?
For instance, after executing calling the save() method on the superMap object, if the server replies with an existing id entry (id as idProp), the instance properties will be updated (otherwise created). But if i want to handle errors caming from the server, sending back a special message, is it possible to get it before the updateData() is executed?
Thank for your suggestion, justin!
I will try that way.
For special message I mean, for instance, an error code and description, to be sent back from the server in case of failure of the update operation.
PUT /my/resource/1
with data { fied1: "a", field2:"b"}
the server will reply
{field1:"a", field2:"b"} // if success
{error:"unable to save due to blabla...", code:123} // if error occurs
The save problem I have when connection to the server fails ( ajax goes to error): it is possible to catch this event?