View Full Version : [CLOSED][3.??] HttpProxy does not catch Exceptions thrown by JsonReader.readResponse

24 Sep 2009, 5:42 AM
Suppose there is a grid with JsonReader and server-side did not return "success" json property, something's broken on the server side.

In this case in HttpProxy.onRead we land in the following block:

if (result.success === false) {
// @deprecated: fire old loadexception for backwards-compat.
this.fireEvent('loadexception', this, o, response);

// Get DataReader read-back a response-object to pass along to exception event
var res = o.reader.readResponse(action, response);
this.fireEvent('exception', this, 'remote', action, o, res, null);

But in JsonReader.readResponse a new exception is thrown which is not catched anywhere:

if (Ext.isEmpty(o[this.meta.successProperty])) {
throw new Ext.data.JsonReader.Error('successProperty-response', this.meta.successProperty);

In the end, uncaught exception is shown in error console and to catch this, I can only handle "loadexception" event, which is depricated.

Is it a bug in the code?

24 Sep 2009, 5:53 AM
Not a bug: http://www.extjs.com/forum/showthread.php?t=17246

24 Sep 2009, 5:56 AM
Got it. Thank you!