PDA

View Full Version : Extracting server error message after model save



apeace
24 Aug 2011, 6:32 AM
The server response is not passed to the `failure` function when saving a model instance. For example:


myModel.save({
success: function ( record, operation ) {
// operation.response
},
failure: function ( record, operation ) {
// no operation.response
}
});

This makes it impossible to extract any error message that the server may have given. The only way to display errors is to have the server respond with a 200 code and give the actual code in the response body. But this only works if the server actually returns a record.

Am I missing something? Are there known workarounds to this?

Thank you for any help.

backchatio
26 Oct 2011, 2:22 AM
I'm desperately trying to figure this out as well.

I have tried setting the messageProperty as suggested on the model's reader config, but that doesn't seem to have any affect on the error returned along with the model instance.

A quick reply would be really appreciated... this has soaked up a lot of time.

PigPopper
21 Nov 2011, 2:38 PM
Bump. I also am looking for a solution or workaround for this.