@hg-ts/exception 0.0.15
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/.eslintcache +1 -0
- package/.eslintrc.json +1 -0
- package/.mocharc.cjs +1 -0
- package/README.md +1 -0
- package/dist/consts.d.ts +2 -0
- package/dist/consts.d.ts.map +1 -0
- package/dist/consts.js +5 -0
- package/dist/consts.js.map +1 -0
- package/dist/exceptions/aggregate-error.exception.d.ts +5 -0
- package/dist/exceptions/aggregate-error.exception.d.ts.map +1 -0
- package/dist/exceptions/aggregate-error.exception.js +24 -0
- package/dist/exceptions/aggregate-error.exception.js.map +1 -0
- package/dist/exceptions/base.aggregate.exception.d.ts +13 -0
- package/dist/exceptions/base.aggregate.exception.d.ts.map +1 -0
- package/dist/exceptions/base.aggregate.exception.js +33 -0
- package/dist/exceptions/base.aggregate.exception.js.map +1 -0
- package/dist/exceptions/base.exception.d.ts +36 -0
- package/dist/exceptions/base.exception.d.ts.map +1 -0
- package/dist/exceptions/base.exception.js +96 -0
- package/dist/exceptions/base.exception.js.map +1 -0
- package/dist/exceptions/error.exception.d.ts +5 -0
- package/dist/exceptions/error.exception.d.ts.map +1 -0
- package/dist/exceptions/error.exception.js +17 -0
- package/dist/exceptions/error.exception.js.map +1 -0
- package/dist/exceptions/forbidden.exception.d.ts +4 -0
- package/dist/exceptions/forbidden.exception.d.ts.map +1 -0
- package/dist/exceptions/forbidden.exception.js +8 -0
- package/dist/exceptions/forbidden.exception.js.map +1 -0
- package/dist/exceptions/index.d.ts +9 -0
- package/dist/exceptions/index.d.ts.map +1 -0
- package/dist/exceptions/index.js +12 -0
- package/dist/exceptions/index.js.map +1 -0
- package/dist/exceptions/not-implemented.exception.d.ts +5 -0
- package/dist/exceptions/not-implemented.exception.d.ts.map +1 -0
- package/dist/exceptions/not-implemented.exception.js +11 -0
- package/dist/exceptions/not-implemented.exception.js.map +1 -0
- package/dist/exceptions/unknown.exception.d.ts +5 -0
- package/dist/exceptions/unknown.exception.d.ts.map +1 -0
- package/dist/exceptions/unknown.exception.js +11 -0
- package/dist/exceptions/unknown.exception.js.map +1 -0
- package/dist/exceptions/will-never-happened.exception.d.ts +5 -0
- package/dist/exceptions/will-never-happened.exception.d.ts.map +1 -0
- package/dist/exceptions/will-never-happened.exception.js +11 -0
- package/dist/exceptions/will-never-happened.exception.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/tests/serialization.test-suite.d.ts +13 -0
- package/dist/tests/serialization.test-suite.d.ts.map +1 -0
- package/dist/tests/serialization.test-suite.js +142 -0
- package/dist/tests/serialization.test-suite.js.map +1 -0
- package/dist/tests/test.aggregate-exception.d.ts +5 -0
- package/dist/tests/test.aggregate-exception.d.ts.map +1 -0
- package/dist/tests/test.aggregate-exception.js +16 -0
- package/dist/tests/test.aggregate-exception.js.map +1 -0
- package/dist/tests/test.d.ts +6 -0
- package/dist/tests/test.d.ts.map +1 -0
- package/dist/tests/test.exception.d.ts +5 -0
- package/dist/tests/test.exception.d.ts.map +1 -0
- package/dist/tests/test.exception.js +11 -0
- package/dist/tests/test.exception.js.map +1 -0
- package/dist/tests/test.js +22 -0
- package/dist/tests/test.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +5 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/stack-trace.formatter.d.ts +6 -0
- package/dist/utils/stack-trace.formatter.d.ts.map +1 -0
- package/dist/utils/stack-trace.formatter.js +30 -0
- package/dist/utils/stack-trace.formatter.js.map +1 -0
- package/dist-esm/consts.d.ts +2 -0
- package/dist-esm/consts.d.ts.map +1 -0
- package/dist-esm/consts.js +2 -0
- package/dist-esm/consts.js.map +1 -0
- package/dist-esm/exceptions/aggregate-error.exception.d.ts +5 -0
- package/dist-esm/exceptions/aggregate-error.exception.d.ts.map +1 -0
- package/dist-esm/exceptions/aggregate-error.exception.js +20 -0
- package/dist-esm/exceptions/aggregate-error.exception.js.map +1 -0
- package/dist-esm/exceptions/base.aggregate.exception.d.ts +13 -0
- package/dist-esm/exceptions/base.aggregate.exception.d.ts.map +1 -0
- package/dist-esm/exceptions/base.aggregate.exception.js +29 -0
- package/dist-esm/exceptions/base.aggregate.exception.js.map +1 -0
- package/dist-esm/exceptions/base.exception.d.ts +36 -0
- package/dist-esm/exceptions/base.exception.d.ts.map +1 -0
- package/dist-esm/exceptions/base.exception.js +91 -0
- package/dist-esm/exceptions/base.exception.js.map +1 -0
- package/dist-esm/exceptions/error.exception.d.ts +5 -0
- package/dist-esm/exceptions/error.exception.d.ts.map +1 -0
- package/dist-esm/exceptions/error.exception.js +13 -0
- package/dist-esm/exceptions/error.exception.js.map +1 -0
- package/dist-esm/exceptions/forbidden.exception.d.ts +4 -0
- package/dist-esm/exceptions/forbidden.exception.d.ts.map +1 -0
- package/dist-esm/exceptions/forbidden.exception.js +4 -0
- package/dist-esm/exceptions/forbidden.exception.js.map +1 -0
- package/dist-esm/exceptions/index.d.ts +9 -0
- package/dist-esm/exceptions/index.d.ts.map +1 -0
- package/dist-esm/exceptions/index.js +9 -0
- package/dist-esm/exceptions/index.js.map +1 -0
- package/dist-esm/exceptions/not-implemented.exception.d.ts +5 -0
- package/dist-esm/exceptions/not-implemented.exception.d.ts.map +1 -0
- package/dist-esm/exceptions/not-implemented.exception.js +7 -0
- package/dist-esm/exceptions/not-implemented.exception.js.map +1 -0
- package/dist-esm/exceptions/unknown.exception.d.ts +5 -0
- package/dist-esm/exceptions/unknown.exception.d.ts.map +1 -0
- package/dist-esm/exceptions/unknown.exception.js +7 -0
- package/dist-esm/exceptions/unknown.exception.js.map +1 -0
- package/dist-esm/exceptions/will-never-happened.exception.d.ts +5 -0
- package/dist-esm/exceptions/will-never-happened.exception.d.ts.map +1 -0
- package/dist-esm/exceptions/will-never-happened.exception.js +7 -0
- package/dist-esm/exceptions/will-never-happened.exception.js.map +1 -0
- package/dist-esm/index.d.ts +3 -0
- package/dist-esm/index.d.ts.map +1 -0
- package/dist-esm/index.js +3 -0
- package/dist-esm/index.js.map +1 -0
- package/dist-esm/tests/serialization.test-suite.d.ts +13 -0
- package/dist-esm/tests/serialization.test-suite.d.ts.map +1 -0
- package/dist-esm/tests/serialization.test-suite.js +139 -0
- package/dist-esm/tests/serialization.test-suite.js.map +1 -0
- package/dist-esm/tests/test.aggregate-exception.d.ts +5 -0
- package/dist-esm/tests/test.aggregate-exception.d.ts.map +1 -0
- package/dist-esm/tests/test.aggregate-exception.js +12 -0
- package/dist-esm/tests/test.aggregate-exception.js.map +1 -0
- package/dist-esm/tests/test.exception.d.ts +5 -0
- package/dist-esm/tests/test.exception.d.ts.map +1 -0
- package/dist-esm/tests/test.exception.js +7 -0
- package/dist-esm/tests/test.exception.js.map +1 -0
- package/dist-esm/utils/index.d.ts +2 -0
- package/dist-esm/utils/index.d.ts.map +1 -0
- package/dist-esm/utils/index.js +2 -0
- package/dist-esm/utils/index.js.map +1 -0
- package/dist-esm/utils/stack-trace.formatter.d.ts +6 -0
- package/dist-esm/utils/stack-trace.formatter.d.ts.map +1 -0
- package/dist-esm/utils/stack-trace.formatter.js +25 -0
- package/dist-esm/utils/stack-trace.formatter.js.map +1 -0
- package/package.json +37 -0
- package/src/consts.ts +1 -0
- package/src/exceptions/aggregate-error.exception.ts +26 -0
- package/src/exceptions/base.aggregate.exception.ts +51 -0
- package/src/exceptions/base.exception.ts +138 -0
- package/src/exceptions/error.exception.ts +16 -0
- package/src/exceptions/forbidden.exception.ts +3 -0
- package/src/exceptions/index.ts +11 -0
- package/src/exceptions/not-implemented.exception.ts +7 -0
- package/src/exceptions/unknown.exception.ts +7 -0
- package/src/exceptions/will-never-happened.exception.ts +7 -0
- package/src/index.ts +2 -0
- package/src/tests/serialization.test-suite.ts +121 -0
- package/src/tests/test.aggregate-exception.ts +16 -0
- package/src/tests/test.exception.ts +7 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/stack-trace.formatter.ts +30 -0
- package/tsconfig.esm.json +9 -0
- package/tsconfig.json +10 -0
package/.eslintcache
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"/Volumes/Work/ts/hg/framework/packages/exception/src/consts.ts":"1","/Volumes/Work/ts/hg/framework/packages/exception/src/exceptions/aggregate-error.exception.ts":"2","/Volumes/Work/ts/hg/framework/packages/exception/src/exceptions/base.aggregate.exception.ts":"3","/Volumes/Work/ts/hg/framework/packages/exception/src/exceptions/base.exception.ts":"4","/Volumes/Work/ts/hg/framework/packages/exception/src/exceptions/error.exception.ts":"5","/Volumes/Work/ts/hg/framework/packages/exception/src/exceptions/forbidden.exception.ts":"6","/Volumes/Work/ts/hg/framework/packages/exception/src/exceptions/index.ts":"7","/Volumes/Work/ts/hg/framework/packages/exception/src/exceptions/not-implemented.exception.ts":"8","/Volumes/Work/ts/hg/framework/packages/exception/src/exceptions/unknown.exception.ts":"9","/Volumes/Work/ts/hg/framework/packages/exception/src/exceptions/will-never-happened.exception.ts":"10","/Volumes/Work/ts/hg/framework/packages/exception/src/index.ts":"11","/Volumes/Work/ts/hg/framework/packages/exception/src/tests/serialization.test-suite.ts":"12","/Volumes/Work/ts/hg/framework/packages/exception/src/tests/test.aggregate-exception.ts":"13","/Volumes/Work/ts/hg/framework/packages/exception/src/tests/test.exception.ts":"14","/Volumes/Work/ts/hg/framework/packages/exception/src/utils/index.ts":"15","/Volumes/Work/ts/hg/framework/packages/exception/src/utils/stack-trace.formatter.ts":"16"},{"size":73,"mtime":1659719206461,"results":"17","hashOfConfig":"18"},{"size":656,"mtime":1631395128717,"results":"19","hashOfConfig":"18"},{"size":1377,"mtime":1660867889450,"results":"20","hashOfConfig":"18"},{"size":3220,"mtime":1664331682837,"results":"21","hashOfConfig":"18"},{"size":375,"mtime":1658005568468,"results":"22","hashOfConfig":"18"},{"size":108,"mtime":1643091718782,"results":"23","hashOfConfig":"18"},{"size":418,"mtime":1643091718779,"results":"24","hashOfConfig":"18"},{"size":169,"mtime":1626299896345,"results":"25","hashOfConfig":"18"},{"size":167,"mtime":1626299896345,"results":"26","hashOfConfig":"18"},{"size":177,"mtime":1626299896345,"results":"27","hashOfConfig":"18"},{"size":53,"mtime":1665300013469,"results":"28","hashOfConfig":"18"},{"size":3373,"mtime":1665300013444,"results":"29","hashOfConfig":"18"},{"size":430,"mtime":1660867792014,"results":"30","hashOfConfig":"18"},{"size":186,"mtime":1657995065457,"results":"31","hashOfConfig":"18"},{"size":41,"mtime":1626299896346,"results":"32","hashOfConfig":"18"},{"size":930,"mtime":1659719246420,"results":"33","hashOfConfig":"18"},{"filePath":"34","messages":"35","suppressedMessages":"36","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1hmldtr",{"filePath":"37","messages":"38","suppressedMessages":"39","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"40","messages":"41","suppressedMessages":"42","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"43","messages":"44","suppressedMessages":"45","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"46","messages":"47","suppressedMessages":"48","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"49","messages":"50","suppressedMessages":"51","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"52","messages":"53","suppressedMessages":"54","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"55","messages":"56","suppressedMessages":"57","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"58","messages":"59","suppressedMessages":"60","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"61","messages":"62","suppressedMessages":"63","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"64","messages":"65","suppressedMessages":"66","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"67","messages":"68","suppressedMessages":"69","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"70","messages":"71","suppressedMessages":"72","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"73","messages":"74","suppressedMessages":"75","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"76","messages":"77","suppressedMessages":"78","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"79","messages":"80","suppressedMessages":"81","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Volumes/Work/ts/hg/framework/packages/exception/src/consts.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/exception/src/exceptions/aggregate-error.exception.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/exception/src/exceptions/base.aggregate.exception.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/exception/src/exceptions/base.exception.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/exception/src/exceptions/error.exception.ts",[],["82"],"/Volumes/Work/ts/hg/framework/packages/exception/src/exceptions/forbidden.exception.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/exception/src/exceptions/index.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/exception/src/exceptions/not-implemented.exception.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/exception/src/exceptions/unknown.exception.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/exception/src/exceptions/will-never-happened.exception.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/exception/src/index.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/exception/src/tests/serialization.test-suite.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/exception/src/tests/test.aggregate-exception.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/exception/src/tests/test.exception.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/exception/src/utils/index.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/exception/src/utils/stack-trace.formatter.ts",[],[],{"ruleId":"83","severity":2,"message":"84","line":11,"column":7,"nodeType":"85","messageId":"86","endLine":11,"endColumn":16,"suppressions":"87"},"no-undefined","Unexpected use of undefined.","Identifier","unexpectedUndefined",["88"],{"kind":"89","justification":"90"},"directive",""]
|
package/.eslintrc.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "extends": "@hg-ts-config/eslint-config" }
|
package/.mocharc.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('@hg-ts/tests/config/common.cjs');
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# @hg/exception
|
package/dist/consts.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,SAAwC,CAAC"}
|
package/dist/consts.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":";;;AAAa,QAAA,kBAAkB,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregate-error.exception.d.ts","sourceRoot":"","sources":["../../src/exceptions/aggregate-error.exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAGpE,qBAAa,uBAAwB,SAAQ,sBAAsB;gBAC/C,KAAK,EAAE,cAAc;CAqBxC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AggregateErrorException = void 0;
|
|
4
|
+
const base_aggregate_exception_1 = require("./base.aggregate.exception");
|
|
5
|
+
const base_exception_1 = require("./base.exception");
|
|
6
|
+
class AggregateErrorException extends base_aggregate_exception_1.BaseAggregateException {
|
|
7
|
+
constructor(error) {
|
|
8
|
+
const { errors } = error;
|
|
9
|
+
super(errors
|
|
10
|
+
.map(error => {
|
|
11
|
+
if (error instanceof AggregateError) {
|
|
12
|
+
base_aggregate_exception_1.BaseAggregateException.fromError(error);
|
|
13
|
+
}
|
|
14
|
+
if (error instanceof Error) {
|
|
15
|
+
return base_exception_1.BaseException.fromError(error);
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
})
|
|
19
|
+
.filter((exception) => exception !== null), error.message);
|
|
20
|
+
this.stack = error.stack;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.AggregateErrorException = AggregateErrorException;
|
|
24
|
+
//# sourceMappingURL=aggregate-error.exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregate-error.exception.js","sourceRoot":"","sources":["../../src/exceptions/aggregate-error.exception.ts"],"names":[],"mappings":";;;AAAA,yEAAoE;AACpE,qDAAiD;AAEjD,MAAa,uBAAwB,SAAQ,iDAAsB;IAClE,YAAmB,KAAqB;QACvC,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;QAEzB,KAAK,CACJ,MAAM;aACJ,GAAG,CAAC,KAAK,CAAC,EAAE;YACZ,IAAI,KAAK,YAAY,cAAc,EAAE;gBACpC,iDAAsB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;aACxC;YACD,IAAI,KAAK,YAAY,KAAK,EAAE;gBAC3B,OAAO,8BAAa,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;aACtC;YAED,OAAO,IAAI,CAAC;QACb,CAAC,CAAC;aACD,MAAM,CAAC,CAAC,SAAS,EAA8B,EAAE,CAAC,SAAS,KAAK,IAAI,CAAC,EACvE,KAAK,CAAC,OAAO,CACb,CAAC;QAED,IAAY,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IACnC,CAAC;CACD;AAtBD,0DAsBC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseException, ExceptionOptions, JSONBaseException } from './base.exception';
|
|
2
|
+
export declare type JSONBaseAggregateException = Omit<JSONBaseException, 'cause'> & {
|
|
3
|
+
exceptions: JSONBaseException[];
|
|
4
|
+
};
|
|
5
|
+
export declare type BaseAggregateExceptionOptions = Omit<ExceptionOptions, 'cause'>;
|
|
6
|
+
export declare abstract class BaseAggregateException extends BaseException {
|
|
7
|
+
readonly exceptions: BaseException[];
|
|
8
|
+
protected constructor(exceptions: BaseException[], message: string, options?: BaseAggregateExceptionOptions);
|
|
9
|
+
toJSON(): JSONBaseAggregateException;
|
|
10
|
+
static fromError(error: AggregateError): BaseAggregateException;
|
|
11
|
+
protected injectBeforeStack(padCount: number): string[];
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=base.aggregate.exception.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.aggregate.exception.d.ts","sourceRoot":"","sources":["../../src/exceptions/base.aggregate.exception.ts"],"names":[],"mappings":"AACA,OAAO,EACN,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EAEjB,MAAM,kBAAkB,CAAC;AAE1B,oBAAY,0BAA0B,GAAG,IAAI,CAAC,iBAAiB,EAAE,OAAO,CAAC,GAAG;IAC3E,UAAU,EAAE,iBAAiB,EAAE,CAAC;CAChC,CAAC;AAEF,oBAAY,6BAA6B,GAAG,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;AAE5E,8BAAsB,sBAAuB,SAAQ,aAAa;IACjE,SAAgB,UAAU,EAAE,aAAa,EAAE,CAAC;IAE5C,SAAS,aACR,UAAU,EAAE,aAAa,EAAE,EAC3B,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,6BAA6B;IAOxB,MAAM,IAAI,0BAA0B;WAS7B,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,sBAAsB;cAI5D,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE;CAUhE"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseAggregateException = void 0;
|
|
4
|
+
const aggregate_error_exception_1 = require("./aggregate-error.exception");
|
|
5
|
+
const base_exception_1 = require("./base.exception");
|
|
6
|
+
class BaseAggregateException extends base_exception_1.BaseException {
|
|
7
|
+
exceptions;
|
|
8
|
+
constructor(exceptions, message, options) {
|
|
9
|
+
super(message, options);
|
|
10
|
+
this.exceptions = exceptions;
|
|
11
|
+
}
|
|
12
|
+
toJSON() {
|
|
13
|
+
const baseJson = super.toJSON();
|
|
14
|
+
return {
|
|
15
|
+
...baseJson,
|
|
16
|
+
exceptions: this.exceptions.map(exception => exception.toJSON()),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
static fromError(error) {
|
|
20
|
+
return new aggregate_error_exception_1.AggregateErrorException(error);
|
|
21
|
+
}
|
|
22
|
+
injectBeforeStack(padCount) {
|
|
23
|
+
const innerExceptionsInfo = this.exceptions
|
|
24
|
+
.map(exception => exception['getStringifyFirstLine']())
|
|
25
|
+
.map(line => base_exception_1.BaseException.padLine(line, padCount));
|
|
26
|
+
return [
|
|
27
|
+
base_exception_1.BaseException.padLine('Aggregated exceptions info:', padCount - base_exception_1.PAD_COUNT_PER_DEPTH),
|
|
28
|
+
...innerExceptionsInfo,
|
|
29
|
+
];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.BaseAggregateException = BaseAggregateException;
|
|
33
|
+
//# sourceMappingURL=base.aggregate.exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.aggregate.exception.js","sourceRoot":"","sources":["../../src/exceptions/base.aggregate.exception.ts"],"names":[],"mappings":";;;AAAA,2EAAsE;AACtE,qDAK0B;AAQ1B,MAAsB,sBAAuB,SAAQ,8BAAa;IACjD,UAAU,CAAkB;IAE5C,YACC,UAA2B,EAC3B,OAAe,EACf,OAAuC;QAEvC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAExB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC9B,CAAC;IAEe,MAAM;QACrB,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;QAEhC,OAAO;YACN,GAAG,QAAQ;YACX,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;SAChE,CAAC;IACH,CAAC;IAEM,MAAM,CAAU,SAAS,CAAC,KAAqB;QACrD,OAAO,IAAI,mDAAuB,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IAEkB,iBAAiB,CAAC,QAAgB;QACpD,MAAM,mBAAmB,GAAG,IAAI,CAAC,UAAU;aACzC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,uBAAuB,CAAC,EAAE,CAAC;aACtD,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,8BAAa,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;QAErD,OAAO;YACN,8BAAa,CAAC,OAAO,CAAC,6BAA6B,EAAE,QAAQ,GAAG,oCAAmB,CAAC;YACpF,GAAG,mBAAmB;SACtB,CAAC;IACH,CAAC;CACD;AApCD,wDAoCC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { InspectOptionsStylized, inspect } from 'util';
|
|
3
|
+
export declare type JSONBaseException = {
|
|
4
|
+
name: string;
|
|
5
|
+
code: Nullable<number>;
|
|
6
|
+
message: string;
|
|
7
|
+
stack: string[];
|
|
8
|
+
cause?: JSONBaseException;
|
|
9
|
+
};
|
|
10
|
+
export declare type ExceptionOptions = {
|
|
11
|
+
cause?: BaseException | undefined;
|
|
12
|
+
code?: number | undefined;
|
|
13
|
+
};
|
|
14
|
+
export declare const PAD_COUNT_PER_DEPTH = 4;
|
|
15
|
+
export declare abstract class BaseException extends Error {
|
|
16
|
+
readonly code: Nullable<number>;
|
|
17
|
+
readonly stack: string;
|
|
18
|
+
readonly message: string;
|
|
19
|
+
readonly cause?: BaseException;
|
|
20
|
+
private serialized;
|
|
21
|
+
constructor(message: string, codeOrOptions?: ExceptionOptions);
|
|
22
|
+
get name(): string;
|
|
23
|
+
toJSON(): JSONBaseException;
|
|
24
|
+
toString(padCount?: number): string;
|
|
25
|
+
[inspect.custom](_depth: Nullable<number>, { stylize }: InspectOptionsStylized): string;
|
|
26
|
+
isFromNextTick(): boolean;
|
|
27
|
+
isFromImmediate(): boolean;
|
|
28
|
+
isFromTimer(): boolean;
|
|
29
|
+
static fromError(error: Error): BaseException;
|
|
30
|
+
protected getCtor(): Function;
|
|
31
|
+
protected getStringifyFirstLine(): string;
|
|
32
|
+
protected injectBeforeStack(padCount: number): string[];
|
|
33
|
+
protected static padLine(line: string, padCount: number): string;
|
|
34
|
+
private getLastStackLine;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=base.exception.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.exception.d.ts","sourceRoot":"","sources":["../../src/exceptions/base.exception.ts"],"names":[],"mappings":";AACA,OAAO,EACN,sBAAsB,EACtB,OAAO,EACP,MAAM,MAAM,CAAC;AAKd,oBAAY,iBAAiB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;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AE,MAAM,GAAG,MAAM;IAIhE,OAAO,CAAC,gBAAgB;CAKxB"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseException = exports.PAD_COUNT_PER_DEPTH = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const os = tslib_1.__importStar(require("os"));
|
|
6
|
+
const util_1 = require("util");
|
|
7
|
+
const utils_1 = require("../utils");
|
|
8
|
+
const error_exception_1 = require("./error.exception");
|
|
9
|
+
exports.PAD_COUNT_PER_DEPTH = 4;
|
|
10
|
+
class BaseException extends Error {
|
|
11
|
+
code = null;
|
|
12
|
+
stack;
|
|
13
|
+
message;
|
|
14
|
+
cause;
|
|
15
|
+
serialized = null;
|
|
16
|
+
constructor(message, codeOrOptions = {}) {
|
|
17
|
+
super(message);
|
|
18
|
+
this.message = message;
|
|
19
|
+
if (codeOrOptions.cause) {
|
|
20
|
+
this.cause = codeOrOptions.cause;
|
|
21
|
+
}
|
|
22
|
+
if (codeOrOptions.code) {
|
|
23
|
+
this.code = codeOrOptions.code;
|
|
24
|
+
}
|
|
25
|
+
Error.captureStackTrace(this, this.getCtor());
|
|
26
|
+
}
|
|
27
|
+
get name() {
|
|
28
|
+
const { name } = this.getCtor();
|
|
29
|
+
return name;
|
|
30
|
+
}
|
|
31
|
+
toJSON() {
|
|
32
|
+
if (this.serialized === null) {
|
|
33
|
+
const { name, message, stack, code, cause } = this;
|
|
34
|
+
this.serialized = {
|
|
35
|
+
name,
|
|
36
|
+
code,
|
|
37
|
+
message,
|
|
38
|
+
stack: utils_1.StackTraceFormatter.format(stack, this.name),
|
|
39
|
+
};
|
|
40
|
+
if (cause) {
|
|
41
|
+
this.serialized.cause = cause.toJSON();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return this.serialized;
|
|
45
|
+
}
|
|
46
|
+
toString(padCount = exports.PAD_COUNT_PER_DEPTH) {
|
|
47
|
+
const { stack } = this.toJSON();
|
|
48
|
+
const formattedStack = stack.map(line => BaseException.padLine(line, padCount));
|
|
49
|
+
const errorLines = [
|
|
50
|
+
this.getStringifyFirstLine(),
|
|
51
|
+
...this.injectBeforeStack(padCount + exports.PAD_COUNT_PER_DEPTH),
|
|
52
|
+
...formattedStack,
|
|
53
|
+
];
|
|
54
|
+
return errorLines.join(os.EOL);
|
|
55
|
+
}
|
|
56
|
+
[util_1.inspect.custom](_depth, { stylize }) {
|
|
57
|
+
return stylize(this.toString(), 'regexp');
|
|
58
|
+
}
|
|
59
|
+
isFromNextTick() {
|
|
60
|
+
const lastLine = this.getLastStackLine();
|
|
61
|
+
return lastLine.includes('processTicksAndRejections');
|
|
62
|
+
}
|
|
63
|
+
isFromImmediate() {
|
|
64
|
+
const lastLine = this.getLastStackLine();
|
|
65
|
+
return lastLine.includes('Immediate._onImmediate');
|
|
66
|
+
}
|
|
67
|
+
isFromTimer() {
|
|
68
|
+
const lastLine = this.getLastStackLine();
|
|
69
|
+
return lastLine.includes('Timeout._onTimeout');
|
|
70
|
+
}
|
|
71
|
+
static fromError(error) {
|
|
72
|
+
return new error_exception_1.ErrorException(error);
|
|
73
|
+
}
|
|
74
|
+
getCtor() {
|
|
75
|
+
return Object.getPrototypeOf(this).constructor;
|
|
76
|
+
}
|
|
77
|
+
getStringifyFirstLine() {
|
|
78
|
+
const { name, code, message } = this.toJSON();
|
|
79
|
+
return `${name}${code === null ? '' : ` [code: ${code}]`}: ${message}`;
|
|
80
|
+
}
|
|
81
|
+
injectBeforeStack(padCount) {
|
|
82
|
+
if (this.cause) {
|
|
83
|
+
return [BaseException.padLine(this.cause.getStringifyFirstLine(), padCount)];
|
|
84
|
+
}
|
|
85
|
+
return [];
|
|
86
|
+
}
|
|
87
|
+
static padLine(line, padCount) {
|
|
88
|
+
return `${' '.repeat(padCount)}${line}`;
|
|
89
|
+
}
|
|
90
|
+
getLastStackLine() {
|
|
91
|
+
const { stack } = this.toJSON();
|
|
92
|
+
return stack[stack.length - 1] ?? '';
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
exports.BaseException = BaseException;
|
|
96
|
+
//# sourceMappingURL=base.exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.exception.js","sourceRoot":"","sources":["../../src/exceptions/base.exception.ts"],"names":[],"mappings":";;;;AAAA,+CAAyB;AACzB,+BAGc;AAEd,oCAA+C;AAC/C,uDAAmD;AAetC,QAAA,mBAAmB,GAAG,CAAC,CAAC;AAErC,MAAsB,aAAc,SAAQ,KAAK;IAChC,IAAI,GAAqB,IAAI,CAAC;IACrB,KAAK,CAAS;IACd,OAAO,CAAS;IAChB,KAAK,CAAiB;IACvC,UAAU,GAAgC,IAAI,CAAC;IAEvD,YAAmB,OAAe,EAAE,gBAAkC,EAAE;QACvE,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAGvB,IAAI,aAAa,CAAC,KAAK,EAAE;YACxB,IAAI,CAAC,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC;SACjC;QACD,IAAI,aAAa,CAAC,IAAI,EAAE;YACvB,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC,IAAI,CAAC;SAC/B;QAED,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,IAAoB,IAAI;QACvB,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAEhC,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,MAAM;QACZ,IAAI,IAAI,CAAC,UAAU,KAAK,IAAI,EAAE;YAC7B,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;YAEnD,IAAI,CAAC,UAAU,GAAG;gBACjB,IAAI;gBACJ,IAAI;gBAC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C;AAEjD,qBAAa,cAAe,SAAQ,aAAa;gBAC7B,KAAK,EAAE,KAAK;CAY/B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ErrorException = void 0;
|
|
4
|
+
const base_exception_1 = require("./base.exception");
|
|
5
|
+
class ErrorException extends base_exception_1.BaseException {
|
|
6
|
+
constructor(error) {
|
|
7
|
+
const { cause } = error;
|
|
8
|
+
super(error.message, {
|
|
9
|
+
cause: cause instanceof Error
|
|
10
|
+
? new ErrorException(cause)
|
|
11
|
+
: undefined,
|
|
12
|
+
});
|
|
13
|
+
this.stack = error.stack;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.ErrorException = ErrorException;
|
|
17
|
+
//# sourceMappingURL=error.exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.exception.js","sourceRoot":"","sources":["../../src/exceptions/error.exception.ts"],"names":[],"mappings":";;;AAAA,qDAAiD;AAEjD,MAAa,cAAe,SAAQ,8BAAa;IAChD,YAAmB,KAAY;QAC9B,MAAM,EAAE,KAAK,EAAE,GAAG,KAAY,CAAC;QAE/B,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE;YACpB,KAAK,EAAE,KAAK,YAAY,KAAK;gBAC5B,CAAC,CAAC,IAAI,cAAc,CAAC,KAAK,CAAC;gBAE3B,CAAC,CAAC,SAAS;SACZ,CAAC,CAAC;QAEF,IAAY,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IACnC,CAAC;CACD;AAbD,wCAaC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forbidden.exception.d.ts","sourceRoot":"","sources":["../../src/exceptions/forbidden.exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,qBAAa,kBAAmB,SAAQ,aAAa;CAAG"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ForbiddenException = void 0;
|
|
4
|
+
const base_exception_1 = require("./base.exception");
|
|
5
|
+
class ForbiddenException extends base_exception_1.BaseException {
|
|
6
|
+
}
|
|
7
|
+
exports.ForbiddenException = ForbiddenException;
|
|
8
|
+
//# sourceMappingURL=forbidden.exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forbidden.exception.js","sourceRoot":"","sources":["../../src/exceptions/forbidden.exception.ts"],"names":[],"mappings":";;;AAAA,qDAAiD;AAEjD,MAAa,kBAAmB,SAAQ,8BAAa;CAAG;AAAxD,gDAAwD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './error.exception';
|
|
2
|
+
export * from './aggregate-error.exception';
|
|
3
|
+
export * from './base.exception';
|
|
4
|
+
export * from './base.aggregate.exception';
|
|
5
|
+
export * from './unknown.exception';
|
|
6
|
+
export * from './not-implemented.exception';
|
|
7
|
+
export * from './will-never-happened.exception';
|
|
8
|
+
export * from './forbidden.exception';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/exceptions/index.ts"],"names":[],"mappings":"AACA,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAE5C,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAE3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./error.exception"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./aggregate-error.exception"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./base.exception"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./base.aggregate.exception"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./unknown.exception"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./not-implemented.exception"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./will-never-happened.exception"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./forbidden.exception"), exports);
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/exceptions/index.ts"],"names":[],"mappings":";;;AACA,4DAAkC;AAClC,sEAA4C;AAE5C,2DAAiC;AACjC,qEAA2C;AAE3C,8DAAoC;AACpC,sEAA4C;AAC5C,0EAAgD;AAChD,gEAAsC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"not-implemented.exception.d.ts","sourceRoot":"","sources":["../../src/exceptions/not-implemented.exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,qBAAa,uBAAwB,SAAQ,aAAa;;CAIzD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotImplementedException = void 0;
|
|
4
|
+
const base_exception_1 = require("./base.exception");
|
|
5
|
+
class NotImplementedException extends base_exception_1.BaseException {
|
|
6
|
+
constructor() {
|
|
7
|
+
super('Not implemented');
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.NotImplementedException = NotImplementedException;
|
|
11
|
+
//# sourceMappingURL=not-implemented.exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"not-implemented.exception.js","sourceRoot":"","sources":["../../src/exceptions/not-implemented.exception.ts"],"names":[],"mappings":";;;AAAA,qDAAiD;AAEjD,MAAa,uBAAwB,SAAQ,8BAAa;IACzD;QACC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAC1B,CAAC;CACD;AAJD,0DAIC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unknown.exception.d.ts","sourceRoot":"","sources":["../../src/exceptions/unknown.exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,qBAAa,gBAAiB,SAAQ,aAAa;gBAC/B,OAAO,EAAE,MAAM;CAGlC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UnknownException = void 0;
|
|
4
|
+
const base_exception_1 = require("./base.exception");
|
|
5
|
+
class UnknownException extends base_exception_1.BaseException {
|
|
6
|
+
constructor(message) {
|
|
7
|
+
super(message);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.UnknownException = UnknownException;
|
|
11
|
+
//# sourceMappingURL=unknown.exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unknown.exception.js","sourceRoot":"","sources":["../../src/exceptions/unknown.exception.ts"],"names":[],"mappings":";;;AAAA,qDAAiD;AAEjD,MAAa,gBAAiB,SAAQ,8BAAa;IAClD,YAAmB,OAAe;QACjC,KAAK,CAAC,OAAO,CAAC,CAAC;IAChB,CAAC;CACD;AAJD,4CAIC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"will-never-happened.exception.d.ts","sourceRoot":"","sources":["../../src/exceptions/will-never-happened.exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,qBAAa,0BAA2B,SAAQ,aAAa;gBACzC,OAAO,EAAE,MAAM;CAGlC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WillNeverHappenedException = void 0;
|
|
4
|
+
const base_exception_1 = require("./base.exception");
|
|
5
|
+
class WillNeverHappenedException extends base_exception_1.BaseException {
|
|
6
|
+
constructor(message) {
|
|
7
|
+
super(message);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.WillNeverHappenedException = WillNeverHappenedException;
|
|
11
|
+
//# sourceMappingURL=will-never-happened.exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"will-never-happened.exception.js","sourceRoot":"","sources":["../../src/exceptions/will-never-happened.exception.ts"],"names":[],"mappings":";;;AAAA,qDAAiD;AAEjD,MAAa,0BAA2B,SAAQ,8BAAa;IAC5D,YAAmB,OAAe;QACjC,KAAK,CAAC,OAAO,CAAC,CAAC;IAChB,CAAC;CACD;AAJD,gEAIC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AACtB,cAAc,cAAc,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,wBAAsB;AACtB,uDAA6B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import '@hg-ts/types';
|
|
2
|
+
import { TestSuite } from '@hg-ts/tests';
|
|
3
|
+
export declare class SerializationTestSuite extends TestSuite {
|
|
4
|
+
commonTest(): Promise<void>;
|
|
5
|
+
baseExceptionFromError(): Promise<void>;
|
|
6
|
+
aggregateExceptionTest(): Promise<void>;
|
|
7
|
+
syncStackTest(): Promise<void>;
|
|
8
|
+
isFromNextTickTest(): Promise<void>;
|
|
9
|
+
isFromImmediateTest(): Promise<void>;
|
|
10
|
+
fromTimeoutTest(): Promise<void>;
|
|
11
|
+
fromIntervalTest(): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=serialization.test-suite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialization.test-suite.d.ts","sourceRoot":"","sources":["../../src/tests/serialization.test-suite.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,EAEN,SAAS,EAGT,MAAM,cAAc,CAAC;AAStB,qBACa,sBAAuB,SAAQ,SAAS;IAEvC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAe3B,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC;IAevC,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC;IAiBvC,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAO9B,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;IAYnC,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAYpC,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAYhC,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;CAY9C"}
|