PDA

View Full Version : [CLOSED][3.0.0] JsonReader doesn't check for error-response on 'create'



Mike Robinson
31 Aug 2009, 10:12 AM
The code in JsonReader.ReadResponse is:

if (Ext.isEmpty(o[this.meta.successProperty])) {
throw new Ext.data.JsonReader.Error('successProperty-response', this.meta.successProperty);
}
// TODO, separate empty and undefined exceptions.
if ((action === Ext.data.Api.actions.create || action === Ext.data.Api.actions.update)) {
if (Ext.isEmpty(o[this.meta.root])) {
throw new Ext.data.JsonReader.Error('root-emtpy', this.meta.root);
}
else if (o[this.meta.root] === undefined) {
throw new Ext.data.JsonReader.Error('root-undefined-response', this.meta.root);
}
} The action being attempted is 'update.'

If the host indicates that the request was not successful, then it is unreasonable to require that it must contain data. In that case, it may well not. Throwing root-emtpy (sic...) is not appropriate behavior.

evant
10 Sep 2009, 5:05 PM
Please post a test case to demonstrate the issue.

mjlecomte
18 Oct 2009, 8:41 AM
This thread has been in the INFOREQ status for some time with no new information posted. I'm going to update the status to CLOSED.