add an error event to the rpc client

This commit is contained in:
Damien Churchill 2009-08-11 22:53:53 +00:00
commit ba909ebcc9

View file

@ -58,7 +58,9 @@ Ext.namespace('Ext.ux.util');
* Fires when the client has retrieved the list of methods from the server. * Fires when the client has retrieved the list of methods from the server.
* @param {Ext.ux.util.RpcClient} this * @param {Ext.ux.util.RpcClient} this
*/ */
'connected' 'connected',
'error'
); );
this.reloadMethods(); this.reloadMethods();
}, },
@ -109,6 +111,7 @@ Ext.namespace('Ext.ux.util');
} else { } else {
options.failure(errorObj, response, requestOptions); options.failure(errorObj, response, requestOptions);
} }
this.fireEvent('error', responseObj, response, requestOptions)
}, },
_onSuccess: function(response, requestOptions) { _onSuccess: function(response, requestOptions) {
@ -121,6 +124,7 @@ Ext.namespace('Ext.ux.util');
} else { } else {
options.failure(responseObj, response, requestOptions); options.failure(responseObj, response, requestOptions);
} }
this.fireEvent('error', responseObj, response, requestOptions)
} else { } else {
if (Ext.type(options.success) != 'function') return; if (Ext.type(options.success) != 'function') return;
if (options.scope) { if (options.scope) {