Results 1 to 7 of 7

Thread: metachange exception handling

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Ext JS Premium Member cdomigan's Avatar
    Join Date
    Mar 2007
    Vote Rating

    Default Answered: metachange exception handling

    I can't seem to see errors thrown within a metachange listener.

    metachange: function(store, meta) {		
    	throw "META ERROR"; // No error thrown! Execution just stops.
    Other async events ('load', etc) are throwing errors just fine in their listeners.

  2. Ah! Now I understand what you mean. Then one of the solutions to escape the try/catch block is to override the getResponseData().
    Ext.define('', {
        override: '',
        getResponseData: function(response) {
            var data, error;
            try {
                data = Ext.decode(response.responseText);
                //return this.readRecords(data);
            } catch (ex) {
                error = new{
                    total  : 0,
                    count  : 0,
                    records: [],
                    success: false,
                    message: ex.message
                this.fireEvent('exception', this, response, error);
                Ext.Logger.warn('Unable to parse the JSON returned by the server');
                return error;
            return this.readRecords(data);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts