deskbookers
Advanced tools
Comparing version 5.2.1 to 5.2.2
@@ -71,2 +71,4 @@ (function (global, factory) { | ||
function InvalidResponseError(text) { | ||
var url = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; | ||
_classCallCheck(this, InvalidResponseError); | ||
@@ -76,10 +78,11 @@ | ||
text = '' + (text || ''); | ||
if (text.length > MAX_ERROR_LENGTH) { | ||
text = text.substr(0, MAX_ERROR_LENGTH) + '...'; | ||
var shortText = text; | ||
if (shortText.length > MAX_ERROR_LENGTH) { | ||
shortText = shortText.substr(0, MAX_ERROR_LENGTH) + '...'; | ||
} | ||
var _this2 = _possibleConstructorReturn(this, (InvalidResponseError.__proto__ || Object.getPrototypeOf(InvalidResponseError)).call(this, 'Invalid API response received: ' + text)); | ||
var _this2 = _possibleConstructorReturn(this, (InvalidResponseError.__proto__ || Object.getPrototypeOf(InvalidResponseError)).call(this, 'Invalid API response received ' + (url ? 'from ' + url : '') + ': ' + shortText)); | ||
_this2.name = 'InvalidResponseError'; | ||
_this2.text = text; | ||
return _this2; | ||
@@ -86,0 +89,0 @@ } |
@@ -176,3 +176,3 @@ (function (global, factory) { | ||
response = _context.sent; | ||
return _context.abrupt('return', this.parseResponse(response)); | ||
return _context.abrupt('return', this.parseResponse(response, requestUrl)); | ||
@@ -196,3 +196,3 @@ case 15: | ||
value: function () { | ||
var _ref4 = _asyncToGenerator(regeneratorRuntime.mark(function _callee2(response) { | ||
var _ref4 = _asyncToGenerator(regeneratorRuntime.mark(function _callee2(response, url) { | ||
var text, data, _data, dataProp, result, errors, error, _errors, _error, msg; | ||
@@ -219,3 +219,3 @@ | ||
_context2.t0 = _context2['catch'](4); | ||
throw new _errors2.InvalidResponseError(text); | ||
throw new _errors2.InvalidResponseError(text, url); | ||
@@ -286,3 +286,3 @@ case 11: | ||
function parseResponse(_x2) { | ||
function parseResponse(_x2, _x3) { | ||
return _ref4.apply(this, arguments); | ||
@@ -289,0 +289,0 @@ } |
{ | ||
"name": "deskbookers", | ||
"version": "5.2.1", | ||
"version": "5.2.2", | ||
"description": "Deskbookers API JavaScript SDK", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
369103
53
5853