|
|
|
@ -204,15 +204,23 @@ var abp = abp || {}; |
|
|
|
|
|
|
|
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { |
|
|
|
var messagePromise = null; |
|
|
|
var responseJSON = null; |
|
|
|
|
|
|
|
if (jqXHR.responseJSON) { |
|
|
|
responseJSON = jqXHR.responseJSON; |
|
|
|
} |
|
|
|
else { |
|
|
|
responseJSON = JSON.parse(jqXHR.responseText) |
|
|
|
} |
|
|
|
|
|
|
|
if (userOptions.abpHandleError !== false) { |
|
|
|
messagePromise = abp.ajax.showError(jqXHR.responseJSON.error); |
|
|
|
messagePromise = abp.ajax.showError(responseJSON.error); |
|
|
|
} |
|
|
|
|
|
|
|
abp.ajax.logError(jqXHR.responseJSON.error); |
|
|
|
abp.ajax.logError(responseJSON.error); |
|
|
|
|
|
|
|
$dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR); |
|
|
|
userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR); |
|
|
|
$dfd && $dfd.reject(responseJSON.error, jqXHR); |
|
|
|
userOptions.error && userOptions.error(responseJSON.error, jqXHR); |
|
|
|
|
|
|
|
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { |
|
|
|
abp.ajax.handleUnAuthorizedRequest(messagePromise); |
|
|
|
|