1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.RequestError = void 0;
|
4 | class 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 | }
|
28 | exports.RequestError = RequestError;
|
29 |
|
\ | No newline at end of file |