fix the error callbacks in the client

This commit is contained in:
Damien Churchill 2009-06-22 07:56:45 +00:00
parent f6b90c0097
commit 7bdc595dd0

View File

@ -101,13 +101,13 @@ Ext.namespace('Ext.ux.util');
errorObj = { errorObj = {
id: options.id, id: options.id,
result: null, result: null,
error: 'HTTP' + response.status error: 'HTTP: ' + response.status + ' ' + response.statusText
} }
if (Ext.type(options.failure) != 'function') return; if (Ext.type(options.failure) != 'function') return;
if (options.scope) { if (options.scope) {
options.failure.call(options.scope, responseObj.error, responseObj, response); options.failure.call(options.scope, errorObj, response, requestOptions);
} else { } else {
options.failure(responseObj.error, responseObj, response); options.failure(errorObj, response, requestOptions);
} }
}, },
@ -117,9 +117,9 @@ Ext.namespace('Ext.ux.util');
if (responseObj.error) { if (responseObj.error) {
if (Ext.type(options.failure) != 'function') return; if (Ext.type(options.failure) != 'function') return;
if (options.scope) { if (options.scope) {
options.failure.call(options.scope, responseObj.error, responseObj, response, requestOptions); options.failure.call(options.scope, responseObj, response, requestOptions);
} else { } else {
options.failure(responseObj.error, responseObj, response, requestOptions); options.failure(responseObj, response, requestOptions);
} }
} else { } else {
if (Ext.type(options.success) != 'function') return; if (Ext.type(options.success) != 'function') return;