@abp/jquery 5.0.0-rc.2 → 5.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.0.0-rc.2",
2
+ "version": "5.1.1",
3
3
  "name": "@abp/jquery",
4
4
  "repository": {
5
5
  "type": "git",
@@ -10,7 +10,7 @@
10
10
  "access": "public"
11
11
  },
12
12
  "dependencies": {
13
- "@abp/core": "~5.0.0-rc.2",
13
+ "@abp/core": "~5.1.1",
14
14
  "jquery": "~3.6.0"
15
15
  },
16
16
  "gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431"
package/src/abp.jquery.js CHANGED
@@ -205,14 +205,16 @@ var abp = abp || {};
205
205
  handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
206
206
  var messagePromise = null;
207
207
 
208
+ var responseJSON = jqXHR.responseJSON ? jqXHR.responseJSON : JSON.parse(jqXHR.responseText);
209
+
208
210
  if (userOptions.abpHandleError !== false) {
209
- messagePromise = abp.ajax.showError(jqXHR.responseJSON.error);
211
+ messagePromise = abp.ajax.showError(responseJSON.error);
210
212
  }
211
213
 
212
- abp.ajax.logError(jqXHR.responseJSON.error);
214
+ abp.ajax.logError(responseJSON.error);
213
215
 
214
- $dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR);
215
- userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR);
216
+ $dfd && $dfd.reject(responseJSON.error, jqXHR);
217
+ userOptions.error && userOptions.error(responseJSON.error, jqXHR);
216
218
 
217
219
  if (jqXHR.status === 401 && userOptions.abpHandleError !== false) {
218
220
  abp.ajax.handleUnAuthorizedRequest(messagePromise);