@cryptexlabs/codex-nodejs-common 0.10.17 → 0.10.18
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/lib/package.json +1 -1
- package/lib/src/exception/index.d.ts +1 -0
- package/lib/src/exception/index.js +1 -0
- package/lib/src/exception/index.js.map +1 -1
- package/lib/src/exception/not-implemented.error.d.ts +5 -0
- package/lib/src/exception/not-implemented.error.js +30 -0
- package/lib/src/exception/not-implemented.error.js.map +1 -0
- package/package.json +1 -1
- package/src/exception/index.ts +1 -0
- package/src/exception/not-implemented.error.ts +25 -0
package/lib/package.json
CHANGED
|
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./friendly-http-exception"), exports);
|
|
18
18
|
__exportStar(require("./contextual.http.exception"), exports);
|
|
19
|
+
__exportStar(require("./not-implemented.error"), exports);
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/exception/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAC1C,8DAA4C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/exception/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAC1C,8DAA4C;AAC5C,0DAAwC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotImplementedError = void 0;
|
|
4
|
+
class NotImplementedError extends Error {
|
|
5
|
+
constructor(clazzMethod) {
|
|
6
|
+
super(`${clazzMethod} not implemented`);
|
|
7
|
+
}
|
|
8
|
+
static throw() {
|
|
9
|
+
throw this.make();
|
|
10
|
+
}
|
|
11
|
+
static make() {
|
|
12
|
+
try {
|
|
13
|
+
throw new Error();
|
|
14
|
+
}
|
|
15
|
+
catch (e) {
|
|
16
|
+
const stack = e.stack || "";
|
|
17
|
+
const stackLines = stack.split("\n");
|
|
18
|
+
const callerLine = stackLines[3];
|
|
19
|
+
const match = callerLine.match(/at (\S+)/);
|
|
20
|
+
if (match && match.length > 1) {
|
|
21
|
+
return new NotImplementedError(match[1]);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
return new NotImplementedError("Unknown");
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.NotImplementedError = NotImplementedError;
|
|
30
|
+
//# sourceMappingURL=not-implemented.error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"not-implemented.error.js","sourceRoot":"","sources":["../../../src/exception/not-implemented.error.ts"],"names":[],"mappings":";;;AAAA,MAAa,mBAAoB,SAAQ,KAAK;IAC5C,YAAoB,WAAW;QAC7B,KAAK,CAAC,GAAG,WAAW,kBAAkB,CAAC,CAAC;IAC1C,CAAC;IAEM,MAAM,CAAC,KAAK;QACjB,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;IACpB,CAAC;IAEM,MAAM,CAAC,IAAI;QAChB,IAAI,CAAC;YACH,MAAM,IAAI,KAAK,EAAE,CAAC;QACpB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;YAC5B,MAAM,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACrC,MAAM,UAAU,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;YACjC,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YAC3C,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC9B,OAAO,IAAI,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YAC3C,CAAC;iBAAM,CAAC;gBACN,OAAO,IAAI,mBAAmB,CAAC,SAAS,CAAC,CAAC;YAC5C,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAxBD,kDAwBC"}
|
package/package.json
CHANGED
package/src/exception/index.ts
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export class NotImplementedError extends Error {
|
|
2
|
+
private constructor(clazzMethod) {
|
|
3
|
+
super(`${clazzMethod} not implemented`);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
public static throw<T>(): T {
|
|
7
|
+
throw this.make();
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
public static make() {
|
|
11
|
+
try {
|
|
12
|
+
throw new Error();
|
|
13
|
+
} catch (e) {
|
|
14
|
+
const stack = e.stack || "";
|
|
15
|
+
const stackLines = stack.split("\n");
|
|
16
|
+
const callerLine = stackLines[3];
|
|
17
|
+
const match = callerLine.match(/at (\S+)/);
|
|
18
|
+
if (match && match.length > 1) {
|
|
19
|
+
return new NotImplementedError(match[1]);
|
|
20
|
+
} else {
|
|
21
|
+
return new NotImplementedError("Unknown");
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|