jsf.js_next_gen 1.0.0-beta-10 → 1.0.0-beta-11

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.
@@ -2054,7 +2054,8 @@ var ErrorData = /** @class */ (function (_super) {
2054
2054
  return _this;
2055
2055
  }
2056
2056
  ErrorData.fromClient = function (e) {
2057
- return new ErrorData("client", e.name, e.message, e.stack);
2057
+ var _a, _b, _c;
2058
+ return new ErrorData("client", (_a = e === null || e === void 0 ? void 0 : e.name) !== null && _a !== void 0 ? _a : '', (_b = e === null || e === void 0 ? void 0 : e.message) !== null && _b !== void 0 ? _b : '', (_c = e === null || e === void 0 ? void 0 : e.stack) !== null && _c !== void 0 ? _c : '');
2058
2059
  };
2059
2060
  ErrorData.fromHttpConnection = function (source, name, message, responseText, responseCode) {
2060
2061
  return new ErrorData(source, name, message, responseText, responseCode, null, "UNKNOWN", ErrorType.HTTP_ERROR);
@@ -3350,9 +3351,6 @@ var XhrRequest = /** @class */ (function () {
3350
3351
  xhrObject.open(this.ajaxType, (0, RequestDataResolver_1.resolveFinalUrl)(this.sourceForm, formData, this.ajaxType), true);
3351
3352
  //adding timeout
3352
3353
  this.timeout ? xhrObject.timeout = this.timeout : null;
3353
- xhrObject.onerror = function (data) {
3354
- _this.handleError(new Error("XHR Error: ".concat(JSON.stringify(data))));
3355
- };
3356
3354
  //a bug in the xhr stub library prevents the setRequestHeader to be properly executed on fake xhr objects
3357
3355
  //normal browsers should resolve this
3358
3356
  //tests can quietly fail on this one
@@ -3470,7 +3468,7 @@ var XhrRequest = /** @class */ (function () {
3470
3468
  }
3471
3469
  };
3472
3470
  try {
3473
- AjaxImpl_1.Implementation.sendError(errorData);
3471
+ this.handleError(errorData, true);
3474
3472
  }
3475
3473
  finally {
3476
3474
  resolve(errorData);
@@ -3505,8 +3503,9 @@ var XhrRequest = /** @class */ (function () {
3505
3503
  throw e;
3506
3504
  }
3507
3505
  };
3508
- XhrRequest.prototype.handleError = function (exception) {
3509
- var errorData = ErrorData_1.ErrorData.fromClient(exception);
3506
+ XhrRequest.prototype.handleError = function (exception, httpError) {
3507
+ if (httpError === void 0) { httpError = false; }
3508
+ var errorData = (httpError) ? ErrorData_1.ErrorData.fromServerError(exception) : ErrorData_1.ErrorData.fromClient(exception);
3510
3509
  var eventHandler = (0, RequestDataResolver_1.resolveHandlerFunc)(this.requestContext, this.responseContext, Const_1.ON_ERROR);
3511
3510
  AjaxImpl_1.Implementation.sendError(errorData, eventHandler);
3512
3511
  };