ismx-nexo-node-app 0.4.78 → 0.4.79
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.
|
@@ -39,12 +39,15 @@ class BusinessErrors {
|
|
|
39
39
|
//this.onExcept?.(error)
|
|
40
40
|
throw error;
|
|
41
41
|
}
|
|
42
|
-
notFound(endpoint) {
|
|
43
|
-
this.except("0004", endpoint);
|
|
44
|
-
}
|
|
45
42
|
unauthorized() {
|
|
46
43
|
this.except("0001");
|
|
47
44
|
}
|
|
45
|
+
badGateway() {
|
|
46
|
+
this.except("0002");
|
|
47
|
+
}
|
|
48
|
+
notFound(endpoint) {
|
|
49
|
+
this.except("0004", endpoint);
|
|
50
|
+
}
|
|
48
51
|
getQuery(key, query) {
|
|
49
52
|
if (!query || !query[key])
|
|
50
53
|
this.except("0011", key);
|
|
@@ -18,8 +18,9 @@ export default class BusinessErrors {
|
|
|
18
18
|
}): void;
|
|
19
19
|
get(code: string, ...params: string[]): ErrorType;
|
|
20
20
|
except(code: string, ...params: string[]): never;
|
|
21
|
-
notFound(endpoint: string): void;
|
|
22
21
|
unauthorized(): void;
|
|
22
|
+
badGateway(): void;
|
|
23
|
+
notFound(endpoint: string): void;
|
|
23
24
|
getQuery(key: string, query: {
|
|
24
25
|
[key: string]: string;
|
|
25
26
|
} | undefined): string;
|
package/package.json
CHANGED
|
@@ -36,14 +36,18 @@ export default class BusinessErrors {
|
|
|
36
36
|
throw error;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
notFound(endpoint: string) {
|
|
40
|
-
this.except("0004", endpoint)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
39
|
unauthorized() {
|
|
44
40
|
this.except("0001");
|
|
45
41
|
}
|
|
46
42
|
|
|
43
|
+
badGateway() {
|
|
44
|
+
this.except("0002");
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
notFound(endpoint: string) {
|
|
48
|
+
this.except("0004", endpoint)
|
|
49
|
+
}
|
|
50
|
+
|
|
47
51
|
getQuery(key: string, query: {[key: string]: string}|undefined): string {
|
|
48
52
|
if (!query || !query[key]) this.except("0011", key)
|
|
49
53
|
return query![key];
|