@activepieces/pieces-common 0.2.28 → 0.2.29
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.
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { AxiosError } from 'axios';
|
|
2
2
|
export declare class HttpError extends Error {
|
|
3
|
-
private readonly
|
|
4
|
-
private readonly
|
|
5
|
-
|
|
3
|
+
private readonly requestBody;
|
|
4
|
+
private readonly status;
|
|
5
|
+
private readonly responseBody;
|
|
6
|
+
constructor(requestBody: unknown, err: AxiosError);
|
|
6
7
|
errorMessage(): {
|
|
7
8
|
response: {
|
|
8
9
|
status: number;
|
|
@@ -2,42 +2,43 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.HttpError = void 0;
|
|
4
4
|
class HttpError extends Error {
|
|
5
|
-
constructor(
|
|
5
|
+
constructor(requestBody, err) {
|
|
6
6
|
var _a, _b;
|
|
7
|
+
const status = ((_a = err === null || err === void 0 ? void 0 : err.response) === null || _a === void 0 ? void 0 : _a.status) || 500;
|
|
8
|
+
const responseBody = (_b = err === null || err === void 0 ? void 0 : err.response) === null || _b === void 0 ? void 0 : _b.data;
|
|
7
9
|
super(JSON.stringify({
|
|
8
10
|
response: {
|
|
9
|
-
status:
|
|
10
|
-
body:
|
|
11
|
+
status: status,
|
|
12
|
+
body: responseBody,
|
|
11
13
|
},
|
|
12
14
|
request: {
|
|
13
|
-
body:
|
|
15
|
+
body: requestBody,
|
|
14
16
|
},
|
|
15
17
|
}));
|
|
16
|
-
this.
|
|
17
|
-
this.
|
|
18
|
+
this.requestBody = requestBody;
|
|
19
|
+
this.status = status;
|
|
20
|
+
this.responseBody = responseBody;
|
|
18
21
|
}
|
|
19
22
|
errorMessage() {
|
|
20
|
-
var _a, _b, _c, _d;
|
|
21
23
|
return {
|
|
22
24
|
response: {
|
|
23
|
-
status:
|
|
24
|
-
body:
|
|
25
|
+
status: this.status,
|
|
26
|
+
body: this.responseBody,
|
|
25
27
|
},
|
|
26
28
|
request: {
|
|
27
|
-
body: this.
|
|
29
|
+
body: this.requestBody,
|
|
28
30
|
},
|
|
29
31
|
};
|
|
30
32
|
}
|
|
31
33
|
get response() {
|
|
32
|
-
var _a, _b, _c, _d;
|
|
33
34
|
return {
|
|
34
|
-
status:
|
|
35
|
-
body:
|
|
35
|
+
status: this.status,
|
|
36
|
+
body: this.responseBody,
|
|
36
37
|
};
|
|
37
38
|
}
|
|
38
39
|
get request() {
|
|
39
40
|
return {
|
|
40
|
-
body: this.
|
|
41
|
+
body: this.requestBody,
|
|
41
42
|
};
|
|
42
43
|
}
|
|
43
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-error.js","sourceRoot":"","sources":["../../../../../../../../../packages/pieces/community/common/src/lib/http/core/http-error.ts"],"names":[],"mappings":";;;AAEA,MAAa,SAAU,SAAQ,KAAK;
|
|
1
|
+
{"version":3,"file":"http-error.js","sourceRoot":"","sources":["../../../../../../../../../packages/pieces/community/common/src/lib/http/core/http-error.ts"],"names":[],"mappings":";;;AAEA,MAAa,SAAU,SAAQ,KAAK;IAIlC,YAA6B,WAAoB,EAAE,GAAe;;QAChE,MAAM,MAAM,GAAG,CAAA,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,QAAQ,0CAAE,MAAM,KAAI,GAAG,CAAC;QAC5C,MAAM,YAAY,GAAG,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,QAAQ,0CAAE,IAAI,CAAC;QAEzC,KAAK,CACH,IAAI,CAAC,SAAS,CAAC;YACb,QAAQ,EAAE;gBACR,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,YAAY;aACnB;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,WAAW;aAClB;SACF,CAAC,CACH,CAAC;QAdyB,gBAAW,GAAX,WAAW,CAAS;QAgB/C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;IAEM,YAAY;QACjB,OAAO;YACL,QAAQ,EAAE;gBACR,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,IAAI,EAAE,IAAI,CAAC,YAAY;aACxB;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,IAAI,CAAC,WAAW;aACvB;SACF,CAAC;IACJ,CAAC;IAED,IAAI,QAAQ;QACV,OAAO;YACL,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,IAAI,EAAE,IAAI,CAAC,YAAY;SACxB,CAAC;IACJ,CAAC;IAED,IAAI,OAAO;QACT,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,WAAW;SACvB,CAAC;IACJ,CAAC;CACF;AAhDD,8BAgDC"}
|