UNPKG

931 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.RequestError = void 0;
4class RequestError extends Error {
5 constructor(error) {
6 super(error.message);
7 Object.defineProperty(this, "message", {
8 enumerable: false,
9 value: error.message,
10 });
11 Object.defineProperty(this, "name", {
12 enumerable: false,
13 value: this.constructor.name,
14 });
15 if (error.response) {
16 Object.defineProperty(this, "response", {
17 enumerable: false,
18 value: {
19 body: error.response.body,
20 headers: error.response.headers,
21 status: error.response.status,
22 },
23 });
24 }
25 Error.captureStackTrace(this, this.constructor);
26 }
27}
28exports.RequestError = RequestError;
29//# sourceMappingURL=errors.js.map
\No newline at end of file