@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.
@@ -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
  };
@@ -143,4 +143,8 @@ export declare const error_codes: {
143
143
  error_code: string;
144
144
  code: number;
145
145
  };
146
+ GATEWAY_ERROR: {
147
+ error_code: string;
148
+ code: number;
149
+ };
146
150
  };
@@ -151,4 +151,8 @@ exports.error_codes = {
151
151
  error_code: "SERVER_ERROR",
152
152
  code: 500000,
153
153
  },
154
+ GATEWAY_ERROR: {
155
+ error_code: "GATEWAY_ERROR",
156
+ code: 500002,
157
+ },
154
158
  };
@@ -13,6 +13,7 @@ export declare const lang: {
13
13
  invalid_code: string;
14
14
  invalid_auth_key: string;
15
15
  server_error: string;
16
+ gateway_error: string;
16
17
  not_authorized: string;
17
18
  forbidden: string;
18
19
  account_blocked: string;
@@ -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: "server error please again letter",
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",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konplit-services/common",
3
- "version": "1.0.207",
3
+ "version": "1.0.209",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",