| 1 |
import { getXHRResponse } from './getXHRResponse'; |
| 2 |
import { createErrorClass } from '../util/createErrorClass'; |
| 3 |
export var AjaxError = createErrorClass(function (_super) { |
| 4 |
return function AjaxErrorImpl(message, xhr, request) { |
| 5 |
this.message = message; |
| 6 |
this.name = 'AjaxError'; |
| 7 |
this.xhr = xhr; |
| 8 |
this.request = request; |
| 9 |
this.status = xhr.status; |
| 10 |
this.responseType = xhr.responseType; |
| 11 |
var response; |
| 12 |
try { |
| 13 |
response = getXHRResponse(xhr); |
| 14 |
} |
| 15 |
catch (err) { |
| 16 |
response = xhr.responseText; |
| 17 |
} |
| 18 |
this.response = response; |
| 19 |
}; |
| 20 |
}); |
| 21 |
export var AjaxTimeoutError = (function () { |
| 22 |
function AjaxTimeoutErrorImpl(xhr, request) { |
| 23 |
AjaxError.call(this, 'ajax timeout', xhr, request); |
| 24 |
this.name = 'AjaxTimeoutError'; |
| 25 |
return this; |
| 26 |
} |
| 27 |
AjaxTimeoutErrorImpl.prototype = Object.create(AjaxError.prototype); |
| 28 |
return AjaxTimeoutErrorImpl; |
| 29 |
})(); |
| 30 |
//# sourceMappingURL=errors.js.map |