@konplit-services/common 1.0.207 → 1.0.209
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/build/errors/gateway-error.d.ts +3 -1
- package/build/errors/gateway-error.js +3 -1
- package/build/helper/errorCodes/error-codes.d.ts +4 -0
- package/build/helper/errorCodes/error-codes.js +4 -0
- package/build/helper/lang/language.d.ts +1 -0
- package/build/helper/lang/language.js +2 -1
- package/package.json +1 -1
|
@@ -4,14 +4,16 @@ import { ErrorReturn } from "./error.interface";
|
|
|
4
4
|
export declare class GatewayError extends CustomError {
|
|
5
5
|
message: string;
|
|
6
6
|
private error_data;
|
|
7
|
+
private gatewayaResponse?;
|
|
7
8
|
readonly statusCode = 502;
|
|
8
|
-
constructor(message: string, error_data: ErrorReturn);
|
|
9
|
+
constructor(message: string, error_data: ErrorReturn, gatewayaResponse?: string | undefined);
|
|
9
10
|
sequalizeErrors(): {
|
|
10
11
|
status: Status;
|
|
11
12
|
errors: {
|
|
12
13
|
message: string;
|
|
13
14
|
code: number;
|
|
14
15
|
error_code: string;
|
|
16
|
+
gatewayaResponse: string | undefined;
|
|
15
17
|
}[];
|
|
16
18
|
};
|
|
17
19
|
}
|
|
@@ -4,10 +4,11 @@ exports.GatewayError = void 0;
|
|
|
4
4
|
const status_1 = require("../helper/status");
|
|
5
5
|
const custom_error_1 = require("./custom-error");
|
|
6
6
|
class GatewayError extends custom_error_1.CustomError {
|
|
7
|
-
constructor(message, error_data) {
|
|
7
|
+
constructor(message, error_data, gatewayaResponse) {
|
|
8
8
|
super(message);
|
|
9
9
|
this.message = message;
|
|
10
10
|
this.error_data = error_data;
|
|
11
|
+
this.gatewayaResponse = gatewayaResponse;
|
|
11
12
|
this.statusCode = 502;
|
|
12
13
|
this.error_data = error_data;
|
|
13
14
|
Object.setPrototypeOf(this, GatewayError.prototype);
|
|
@@ -20,6 +21,7 @@ class GatewayError extends custom_error_1.CustomError {
|
|
|
20
21
|
message: this.message,
|
|
21
22
|
code: this.error_data.code,
|
|
22
23
|
error_code: this.error_data.error_code,
|
|
24
|
+
gatewayaResponse: this.gatewayaResponse,
|
|
23
25
|
},
|
|
24
26
|
],
|
|
25
27
|
};
|
|
@@ -19,7 +19,8 @@ exports.lang = {
|
|
|
19
19
|
invalid_auth_key: "invalid authorization key provided",
|
|
20
20
|
//account
|
|
21
21
|
// SERVICE DOWN
|
|
22
|
-
server_error: "
|
|
22
|
+
server_error: "Server error please again later",
|
|
23
|
+
gateway_error: "Sorry, something went wrong. The server is temporarily unable to process your request.",
|
|
23
24
|
//Authorization
|
|
24
25
|
not_authorized: "you are not authorized. authenticate and try again",
|
|
25
26
|
forbidden: "You don't have permission to access this resource",
|