@futdevpro/fsm-dynamo 1.5.61 → 1.5.63
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/_models/control-models/error.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/error.control-model.js +36 -14
- package/lib/_models/control-models/error.control-model.js.map +1 -1
- package/lib/_models/control-models/error.control-model.spec.js +330 -47
- package/lib/_models/control-models/error.control-model.spec.js.map +1 -1
- package/lib/_models/data-models/metadata.data-model.d.ts.map +1 -1
- package/lib/_models/data-models/metadata.data-model.js +1 -4
- package/lib/_models/data-models/metadata.data-model.js.map +1 -1
- package/lib/_utils/log.util.d.ts.map +1 -1
- package/lib/_utils/log.util.js +4 -5
- package/lib/_utils/log.util.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +5 -6
- package/package.json +1 -1
- package/src/_models/control-models/error.control-model.spec.ts +379 -51
- package/src/_models/control-models/error.control-model.ts +37 -14
- package/src/_models/data-models/metadata.data-model.ts +1 -4
- package/src/_utils/log.util.ts +4 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.control-model.d.ts","sourceRoot":"","sources":["../../../src/_models/control-models/error.control-model.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAErE,oBAAY,OAAO,GAAG,YAAY,CAAC;AAEnC,qBAAa,YAAa,SAAQ,eAAe;IAC/C,QAAQ,CAAC,IAAI,4BAA4B;IAEzC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,EAAE,CAAM;IAE3B,yDAAyD;IACzD,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,EAAE,CAAM;IAEzB,aAAa,EAAE,MAAM,CAAC;IACtB,yDAAyD;IACzD,cAAc,EAAE,MAAM,EAAE,CAAM;IAE9B,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IAEzB,KAAK,EAAE,KAAK,GAAG,YAAY,CAAC;IAC5B,MAAM,EAAE,CAAC,KAAK,GAAG,YAAY,CAAC,EAAE,CAAM;gBAGpC,GAAG,CAAC,EAAE;QACJ,GAAG,CAAC,EAAE,MAAM,CAAC;QAEb,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;QAEhB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,cAAc,CAAC,EAAE,OAAO,CAAC;QAEzB,KAAK,CAAC,EAAE,KAAK,GAAG,YAAY,CAAC;QAE7B,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,aAAa,CAAC,EAAE,MAAM,CAAC;QAEvB,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,GAAG,CAAC,EAAE,OAAO,CAAC;QAEd,SAAS,CAAC,EAAE,IAAI,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,cAAc,CAAC,EAAE,IAAI,CAAC;QACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;KACd;
|
|
1
|
+
{"version":3,"file":"error.control-model.d.ts","sourceRoot":"","sources":["../../../src/_models/control-models/error.control-model.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAErE,oBAAY,OAAO,GAAG,YAAY,CAAC;AAEnC,qBAAa,YAAa,SAAQ,eAAe;IAC/C,QAAQ,CAAC,IAAI,4BAA4B;IAEzC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,EAAE,CAAM;IAE3B,yDAAyD;IACzD,QAAQ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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuOG;AACH,MAAM,WAAW,yBAAyB;CAAG"}
|
|
@@ -28,6 +28,10 @@ class Dynamo_Error extends metadata_data_model_1.Dynamo_Metadata {
|
|
|
28
28
|
if (!set.errorCode) {
|
|
29
29
|
set.errorCode = error_defaults_const_1.dynamo_error_default.errorCode;
|
|
30
30
|
}
|
|
31
|
+
/** set default error (self defined) */
|
|
32
|
+
if (!(set === null || set === void 0 ? void 0 : set.error)) {
|
|
33
|
+
set.error = new Error();
|
|
34
|
+
}
|
|
31
35
|
/** set errorCodes */
|
|
32
36
|
const previousErrorCodes = [];
|
|
33
37
|
if ((_s = set === null || set === void 0 ? void 0 : set.error) === null || _s === void 0 ? void 0 : _s._errorCodes) {
|
|
@@ -47,9 +51,9 @@ class Dynamo_Error extends metadata_data_model_1.Dynamo_Metadata {
|
|
|
47
51
|
if (!((_x = (_w = set === null || set === void 0 ? void 0 : set.error) === null || _w === void 0 ? void 0 : _w.flag) === null || _x === void 0 ? void 0 : _x.includes('DYNAMO')) && ((_y = set === null || set === void 0 ? void 0 : set.error) === null || _y === void 0 ? void 0 : _y.message)) {
|
|
48
52
|
set.message = (_z = set === null || set === void 0 ? void 0 : set.error) === null || _z === void 0 ? void 0 : _z.message;
|
|
49
53
|
}
|
|
50
|
-
else {
|
|
54
|
+
else if (set.error.stack) {
|
|
51
55
|
/** error not defined */
|
|
52
|
-
const posFull = (_1 = (_0 =
|
|
56
|
+
const posFull = (_1 = (_0 = set.error.stack.split('\n')) === null || _0 === void 0 ? void 0 : _0[2]) === null || _1 === void 0 ? void 0 : _1.split('\\');
|
|
53
57
|
set.message = error_defaults_const_1.dynamo_error_default.message + '; ' + posFull[posFull.length - 1];
|
|
54
58
|
}
|
|
55
59
|
}
|
|
@@ -76,7 +80,7 @@ class Dynamo_Error extends metadata_data_model_1.Dynamo_Metadata {
|
|
|
76
80
|
if (!set.userMessage) {
|
|
77
81
|
set.userMessage = error_defaults_const_1.dynamo_error_default.userMessage;
|
|
78
82
|
}
|
|
79
|
-
if (set.addECToUserMsg && set.errorCode) {
|
|
83
|
+
if (set.addECToUserMsg && set.userMessage !== error_defaults_const_1.dynamo_error_default.userMessage && set.errorCode) {
|
|
80
84
|
set.userMessage += `\nErrorCode: ${set.errorCode}`;
|
|
81
85
|
}
|
|
82
86
|
this.__userMessages = [...previousUserMessages, set === null || set === void 0 ? void 0 : set.userMessage].filter(Boolean);
|
|
@@ -93,6 +97,16 @@ class Dynamo_Error extends metadata_data_model_1.Dynamo_Metadata {
|
|
|
93
97
|
}
|
|
94
98
|
this.errors = [...previousErrors, set === null || set === void 0 ? void 0 : set.error].filter(Boolean);
|
|
95
99
|
this.error = (_12 = this.errors) === null || _12 === void 0 ? void 0 : _12[0];
|
|
100
|
+
this.errors.map((error) => {
|
|
101
|
+
var _a, _b, _c;
|
|
102
|
+
if ((_b = (_a = error) === null || _a === void 0 ? void 0 : _a.flag) === null || _b === void 0 ? void 0 : _b.includes('DYNAMO')) {
|
|
103
|
+
const subError = Object.assign({}, error);
|
|
104
|
+
if ((_c = subError) === null || _c === void 0 ? void 0 : _c.errors) {
|
|
105
|
+
delete subError.errors;
|
|
106
|
+
}
|
|
107
|
+
return subError;
|
|
108
|
+
}
|
|
109
|
+
});
|
|
96
110
|
if (set === null || set === void 0 ? void 0 : set.modestLog) {
|
|
97
111
|
console.error((_14 = (_13 = this._message) !== null && _13 !== void 0 ? _13 : this.__userMessage) !== null && _14 !== void 0 ? _14 : this.error);
|
|
98
112
|
}
|
|
@@ -109,26 +123,34 @@ class Dynamo_Error extends metadata_data_model_1.Dynamo_Metadata {
|
|
|
109
123
|
var _a, _b;
|
|
110
124
|
const error = Object.assign({}, this);
|
|
111
125
|
delete error.errors;
|
|
112
|
-
if ((_a = error.error) === null || _a === void 0 ? void 0 : _a.
|
|
113
|
-
delete error.error.errors;
|
|
114
|
-
}
|
|
115
|
-
if ((_b = error.error) === null || _b === void 0 ? void 0 : _b.error) {
|
|
126
|
+
if ((_a = error.error) === null || _a === void 0 ? void 0 : _a.error) {
|
|
116
127
|
delete error.error.error;
|
|
117
128
|
}
|
|
129
|
+
if ((_b = error.error) === null || _b === void 0 ? void 0 : _b.errors) {
|
|
130
|
+
delete error.error.errors;
|
|
131
|
+
}
|
|
118
132
|
return error;
|
|
119
133
|
}
|
|
120
134
|
getErrorsFlat() {
|
|
135
|
+
var _a, _b;
|
|
121
136
|
const error = Object.assign({}, this);
|
|
122
|
-
error.
|
|
137
|
+
if ((_a = error.error) === null || _a === void 0 ? void 0 : _a.error) {
|
|
138
|
+
delete error.error.error;
|
|
139
|
+
}
|
|
140
|
+
if ((_b = error.error) === null || _b === void 0 ? void 0 : _b.errors) {
|
|
141
|
+
delete error.error.errors;
|
|
142
|
+
}
|
|
143
|
+
error.errors.map((err) => {
|
|
123
144
|
var _a, _b;
|
|
124
|
-
|
|
125
|
-
|
|
145
|
+
const subError = Object.assign({}, err);
|
|
146
|
+
if (subError.errors) {
|
|
147
|
+
delete subError.errors;
|
|
126
148
|
}
|
|
127
|
-
if ((_a =
|
|
128
|
-
delete
|
|
149
|
+
if ((_a = subError.error) === null || _a === void 0 ? void 0 : _a.errors) {
|
|
150
|
+
delete subError.error.errors;
|
|
129
151
|
}
|
|
130
|
-
if ((_b =
|
|
131
|
-
delete
|
|
152
|
+
if ((_b = subError.error) === null || _b === void 0 ? void 0 : _b.error) {
|
|
153
|
+
delete subError.error.error;
|
|
132
154
|
}
|
|
133
155
|
});
|
|
134
156
|
return error;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.control-model.js","sourceRoot":"","sources":["../../../src/_models/control-models/error.control-model.ts"],"names":[],"mappings":";;;AAAA,gFAA6E;AAC7E,oDAAmD;AACnD,4EAAqE;AAIrE,MAAa,YAAa,SAAQ,qCAAe;IAwB/C,YACE,GAyBC;;QAED,KAAK,CAAC,GAAG,EAAE,EAAE,MAAM,cAAE,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,aAAa,yCAAK,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,KAAsB,0CAAE,gBAAgB,mCAAI,2CAAoB,CAAC,aAAa,EAAE,CAAC,CAAC;QAnD5H,SAAI,GAAG,wBAAwB,CAAC;QAGzC,gBAAW,GAAa,EAAE,CAAC;QAI3B,cAAS,GAAa,EAAE,CAAC;QAGzB,yDAAyD;QACzD,mBAAc,GAAa,EAAE,CAAC;QAU9B,WAAM,GAA6B,EAAE,CAAC;QAgCpC,IAAI;YACF,IAAI,CAAC,GAAG,EAAE;gBACR,GAAG,GAAG,EAAE,CAAC;aACV;YAED,4BAA4B;YAC5B,IAAI,CAAC,UAAU,GAAG,OAAO,OAAC,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,yCAAK,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,KAAsB,0CAAE,UAAU,CAAC,CAAC;YACpF,IAAI,CAAC,SAAS,SAAG,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,MAAM,yCAAK,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,KAAsB,0CAAE,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"error.control-model.js","sourceRoot":"","sources":["../../../src/_models/control-models/error.control-model.ts"],"names":[],"mappings":";;;AAAA,gFAA6E;AAC7E,oDAAmD;AACnD,4EAAqE;AAIrE,MAAa,YAAa,SAAQ,qCAAe;IAwB/C,YACE,GAyBC;;QAED,KAAK,CAAC,GAAG,EAAE,EAAE,MAAM,cAAE,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,aAAa,yCAAK,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,KAAsB,0CAAE,gBAAgB,mCAAI,2CA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|
let error_base;
|
|
9
9
|
let error_0;
|
|
10
10
|
let error_stack_1;
|
|
11
|
+
let error_stack_withoutSubErrors_1;
|
|
11
12
|
let error_stack_2;
|
|
13
|
+
let error_stack_withoutSubErrors_2;
|
|
12
14
|
let error_selfDefined;
|
|
13
15
|
const message_base = '-TEST ERROR: something failed!-';
|
|
14
16
|
const message_1 = 'TEST ERROR MSG (1)';
|
|
15
17
|
const message_2 = 'TEST ERROR MSG (2)';
|
|
16
|
-
const message_selfDefined = error_defaults_const_1.dynamo_error_default.message + '; error.control-model.spec.js:
|
|
18
|
+
const message_selfDefined = error_defaults_const_1.dynamo_error_default.message + '; error.control-model.spec.js:69:29';
|
|
17
19
|
const errorCode_0 = 'ASD-ASD-001';
|
|
18
20
|
const errorCode_1 = 'ASD-ASD-002';
|
|
19
21
|
const errorCode_2 = 'ASD-ASD-003';
|
|
@@ -45,6 +47,12 @@ describe('Dynamo_Error;', () => {
|
|
|
45
47
|
handled: true,
|
|
46
48
|
error: error_0,
|
|
47
49
|
});
|
|
50
|
+
error_stack_withoutSubErrors_1 = Object.assign({}, error_stack_1);
|
|
51
|
+
error_stack_withoutSubErrors_1.errors.forEach((error) => {
|
|
52
|
+
const subError = Object.assign({}, error);
|
|
53
|
+
delete subError.errors;
|
|
54
|
+
return subError;
|
|
55
|
+
});
|
|
48
56
|
error_stack_2 = new error_control_model_1.Dynamo_Error({
|
|
49
57
|
message: message_2,
|
|
50
58
|
userMessage: userMessage_2,
|
|
@@ -52,11 +60,23 @@ describe('Dynamo_Error;', () => {
|
|
|
52
60
|
errorCode: errorCode_2,
|
|
53
61
|
error: error_stack_1,
|
|
54
62
|
});
|
|
63
|
+
error_stack_withoutSubErrors_2 = Object.assign({}, error_stack_2);
|
|
64
|
+
error_stack_withoutSubErrors_2.errors.map((error) => {
|
|
65
|
+
const subError = Object.assign({}, error);
|
|
66
|
+
delete subError.errors;
|
|
67
|
+
return subError;
|
|
68
|
+
});
|
|
55
69
|
error_selfDefined = new error_control_model_1.Dynamo_Error();
|
|
56
70
|
}));
|
|
57
71
|
if (log)
|
|
58
72
|
afterAll(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
59
|
-
log_util_1.Dynamo_Log.testLog('
|
|
73
|
+
log_util_1.Dynamo_Log.testLog('error_stack_2:\n', error_stack_2);
|
|
74
|
+
log_util_1.Dynamo_Log.testLog('error_stack_2.getFlat:\n', error_stack_2.getErrorsFlat());
|
|
75
|
+
log_util_1.Dynamo_Log.testLog('error_stack_2.getSimplified:\n', error_stack_2.getErrorSimplified());
|
|
76
|
+
log_util_1.Dynamo_Log.testLog('error_stack_withoutSubErrors_2:\n', error_stack_withoutSubErrors_2);
|
|
77
|
+
log_util_1.Dynamo_Log.testLog('error_selfDefined:\n', error_selfDefined);
|
|
78
|
+
log_util_1.Dynamo_Log.testLog('error_selfDefined.getFlat:\n', error_selfDefined.getErrorsFlat());
|
|
79
|
+
log_util_1.Dynamo_Log.testLog('error_selfDefined.getSimplified:\n', error_selfDefined.getErrorSimplified());
|
|
60
80
|
}));
|
|
61
81
|
describe('should be defined;', () => {
|
|
62
82
|
it('error object', () => {
|
|
@@ -100,130 +120,131 @@ describe('Dynamo_Error;', () => {
|
|
|
100
120
|
expect(error_selfDefined._errorCode).toBe(error_defaults_const_1.dynamo_error_default.errorCode);
|
|
101
121
|
});
|
|
102
122
|
});
|
|
103
|
-
describe('should have the proper
|
|
123
|
+
describe('should have the proper _errorCodes;', () => {
|
|
104
124
|
it('on error_0', () => {
|
|
105
|
-
expect(error_0.
|
|
125
|
+
expect(error_0._errorCodes).toEqual([errorCode_0]);
|
|
106
126
|
});
|
|
107
127
|
it('on error_stack_1', () => {
|
|
108
|
-
expect(error_stack_1.
|
|
128
|
+
expect(error_stack_1._errorCodes).toEqual([errorCode_0, errorCode_1]);
|
|
109
129
|
});
|
|
110
130
|
it('on error_stack_2', () => {
|
|
111
|
-
expect(error_stack_2.
|
|
131
|
+
expect(error_stack_2._errorCodes).toEqual([errorCode_0, errorCode_1, errorCode_2]);
|
|
112
132
|
});
|
|
113
133
|
it('on self defined error', () => {
|
|
114
|
-
expect(error_selfDefined.
|
|
134
|
+
expect(error_selfDefined._errorCodes).toEqual([error_defaults_const_1.dynamo_error_default.errorCode]);
|
|
115
135
|
});
|
|
116
136
|
});
|
|
117
|
-
describe('should have the proper
|
|
137
|
+
describe('should have the proper _message;', () => {
|
|
118
138
|
it('on error_0', () => {
|
|
119
|
-
expect(error_0.
|
|
139
|
+
expect(error_0._message).toBe(message_base);
|
|
120
140
|
});
|
|
121
141
|
it('on error_stack_1', () => {
|
|
122
|
-
expect(error_stack_1.
|
|
142
|
+
expect(error_stack_1._message).toBe(message_base);
|
|
123
143
|
});
|
|
124
144
|
it('on error_stack_2', () => {
|
|
125
|
-
expect(error_stack_2.
|
|
145
|
+
expect(error_stack_2._message).toBe(message_base);
|
|
126
146
|
});
|
|
127
147
|
it('on self defined error', () => {
|
|
128
|
-
expect(error_selfDefined.
|
|
148
|
+
expect(error_selfDefined._message).toBe(message_selfDefined);
|
|
129
149
|
});
|
|
130
150
|
});
|
|
131
|
-
describe('should have proper
|
|
151
|
+
describe('should have the proper _messages;', () => {
|
|
132
152
|
it('on error_0', () => {
|
|
133
|
-
expect(error_0.
|
|
153
|
+
expect(error_0._messages).toEqual([message_base]);
|
|
134
154
|
});
|
|
135
155
|
it('on error_stack_1', () => {
|
|
136
|
-
expect(error_stack_1.
|
|
156
|
+
expect(error_stack_1._messages).toEqual([message_base, message_1]);
|
|
137
157
|
});
|
|
138
158
|
it('on error_stack_2', () => {
|
|
139
|
-
expect(error_stack_2.
|
|
159
|
+
expect(error_stack_2._messages).toEqual([message_base, message_1, message_2]);
|
|
140
160
|
});
|
|
141
161
|
it('on self defined error', () => {
|
|
142
|
-
expect(error_selfDefined.
|
|
162
|
+
expect(error_selfDefined._messages).toEqual([message_selfDefined]);
|
|
143
163
|
});
|
|
144
164
|
});
|
|
145
|
-
describe('should have proper
|
|
165
|
+
describe('should have the proper __userMessage;', () => {
|
|
146
166
|
it('on error_0', () => {
|
|
147
|
-
expect(error_0.
|
|
167
|
+
expect(error_0.__userMessage).toBe(userMessageResult_0);
|
|
148
168
|
});
|
|
149
169
|
it('on error_stack_1', () => {
|
|
150
|
-
expect(error_stack_1.
|
|
170
|
+
expect(error_stack_1.__userMessage).toBe(userMessageResult_0);
|
|
151
171
|
});
|
|
152
172
|
it('on error_stack_2', () => {
|
|
153
|
-
expect(error_stack_2.
|
|
173
|
+
expect(error_stack_2.__userMessage).toBe(userMessageResult_0);
|
|
154
174
|
});
|
|
155
175
|
it('on self defined error', () => {
|
|
156
|
-
expect(error_selfDefined.
|
|
176
|
+
expect(error_selfDefined.__userMessage).toBeUndefined();
|
|
157
177
|
});
|
|
158
178
|
});
|
|
159
|
-
describe('should have
|
|
179
|
+
describe('should have the proper __userMessages;', () => {
|
|
160
180
|
it('on error_0', () => {
|
|
161
|
-
expect(error_0.
|
|
181
|
+
expect(error_0.__userMessages).toEqual([userMessageResult_0]);
|
|
162
182
|
});
|
|
163
183
|
it('on error_stack_1', () => {
|
|
164
|
-
expect(error_stack_1.
|
|
184
|
+
expect(error_stack_1.__userMessages).toEqual([userMessageResult_0, error_defaults_const_1.dynamo_error_default.userMessage]);
|
|
165
185
|
});
|
|
166
186
|
it('on error_stack_2', () => {
|
|
167
|
-
expect(error_stack_2.
|
|
187
|
+
expect(error_stack_2.__userMessages).toEqual([userMessageResult_0, error_defaults_const_1.dynamo_error_default.userMessage, userMessageResult_2]);
|
|
168
188
|
});
|
|
169
189
|
it('on self defined error', () => {
|
|
170
|
-
expect(error_selfDefined.
|
|
190
|
+
expect(error_selfDefined.__userMessages).toEqual([error_defaults_const_1.dynamo_error_default.userMessage]);
|
|
171
191
|
});
|
|
172
192
|
});
|
|
173
|
-
describe('should have
|
|
193
|
+
describe('should have proper error;', () => {
|
|
174
194
|
it('on error_0', () => {
|
|
175
|
-
expect(error_0.
|
|
195
|
+
expect(error_0.error).toBe(error_base);
|
|
176
196
|
});
|
|
177
197
|
it('on error_stack_1', () => {
|
|
178
|
-
expect(error_stack_1.
|
|
198
|
+
expect(error_stack_1.error).toBe(error_base);
|
|
179
199
|
});
|
|
180
200
|
it('on error_stack_2', () => {
|
|
181
|
-
expect(error_stack_2.
|
|
201
|
+
expect(error_stack_2.error).toBe(error_base);
|
|
182
202
|
});
|
|
183
203
|
it('on self defined error', () => {
|
|
184
|
-
expect(error_selfDefined.
|
|
204
|
+
expect(error_selfDefined.error).toBeDefined();
|
|
185
205
|
});
|
|
186
206
|
});
|
|
187
|
-
describe('should have the proper
|
|
207
|
+
describe('should have the proper errors;', () => {
|
|
188
208
|
it('on error_0', () => {
|
|
189
|
-
expect(error_0.
|
|
209
|
+
expect(error_0.errors).toEqual([error_base]);
|
|
190
210
|
});
|
|
191
211
|
it('on error_stack_1', () => {
|
|
192
|
-
expect(error_stack_1.
|
|
212
|
+
expect(error_stack_1.errors).toEqual([error_base, error_0]);
|
|
193
213
|
});
|
|
194
214
|
it('on error_stack_2', () => {
|
|
195
|
-
expect(error_stack_2.
|
|
215
|
+
expect(error_stack_2.errors).toEqual([error_base, error_0, error_stack_1]);
|
|
196
216
|
});
|
|
197
217
|
it('on self defined error', () => {
|
|
198
|
-
|
|
218
|
+
var _a;
|
|
219
|
+
expect((_a = error_selfDefined === null || error_selfDefined === void 0 ? void 0 : error_selfDefined.errors) === null || _a === void 0 ? void 0 : _a.length).toBe(1);
|
|
199
220
|
});
|
|
200
221
|
});
|
|
201
|
-
describe('should have
|
|
222
|
+
describe('should have proper handled;', () => {
|
|
202
223
|
it('on error_0', () => {
|
|
203
|
-
expect(error_0.
|
|
224
|
+
expect(error_0.___handled).toBe(false);
|
|
204
225
|
});
|
|
205
226
|
it('on error_stack_1', () => {
|
|
206
|
-
expect(error_stack_1.
|
|
227
|
+
expect(error_stack_1.___handled).toBe(true);
|
|
207
228
|
});
|
|
208
229
|
it('on error_stack_2', () => {
|
|
209
|
-
expect(error_stack_2.
|
|
230
|
+
expect(error_stack_2.___handled).toBe(true);
|
|
210
231
|
});
|
|
211
232
|
it('on self defined error', () => {
|
|
212
|
-
expect(error_selfDefined.
|
|
233
|
+
expect(error_selfDefined.___handled).toBe(false);
|
|
213
234
|
});
|
|
214
235
|
});
|
|
215
|
-
describe('should have
|
|
236
|
+
describe('should have status: undefined;', () => {
|
|
216
237
|
it('on error_0', () => {
|
|
217
|
-
expect(error_0.
|
|
238
|
+
expect(error_0.___status).toBe(undefined);
|
|
218
239
|
});
|
|
219
240
|
it('on error_stack_1', () => {
|
|
220
|
-
expect(error_stack_1.
|
|
241
|
+
expect(error_stack_1.___status).toBe(undefined);
|
|
221
242
|
});
|
|
222
243
|
it('on error_stack_2', () => {
|
|
223
|
-
expect(error_stack_2.
|
|
244
|
+
expect(error_stack_2.___status).toBe(undefined);
|
|
224
245
|
});
|
|
225
246
|
it('on self defined error', () => {
|
|
226
|
-
expect(error_selfDefined.
|
|
247
|
+
expect(error_selfDefined.___status).toBe(undefined);
|
|
227
248
|
});
|
|
228
249
|
});
|
|
229
250
|
describe('should have the proper issuer;', () => {
|
|
@@ -268,5 +289,267 @@ describe('Dynamo_Error;', () => {
|
|
|
268
289
|
expect(error_selfDefined.___issuerService).toBe(error_defaults_const_1.dynamo_error_default.issuerService);
|
|
269
290
|
});
|
|
270
291
|
});
|
|
292
|
+
describe('should have get proper simplified;', () => {
|
|
293
|
+
let simplified;
|
|
294
|
+
describe('on error_0;', () => {
|
|
295
|
+
beforeEach(() => {
|
|
296
|
+
simplified = error_0.getErrorSimplified();
|
|
297
|
+
});
|
|
298
|
+
it('should be defined', () => {
|
|
299
|
+
expect(simplified).toBeDefined();
|
|
300
|
+
});
|
|
301
|
+
it('should have error', () => {
|
|
302
|
+
expect(simplified.error).toBeDefined();
|
|
303
|
+
});
|
|
304
|
+
it('should not have errors', () => {
|
|
305
|
+
expect(simplified.errors).toBeUndefined();
|
|
306
|
+
});
|
|
307
|
+
it('should not have simplified.error.error', () => {
|
|
308
|
+
var _a;
|
|
309
|
+
expect((_a = simplified.error) === null || _a === void 0 ? void 0 : _a.error).toBeUndefined();
|
|
310
|
+
});
|
|
311
|
+
it('should not have simplified.error.errors', () => {
|
|
312
|
+
var _a;
|
|
313
|
+
expect((_a = simplified.error) === null || _a === void 0 ? void 0 : _a.errors).toBeUndefined();
|
|
314
|
+
});
|
|
315
|
+
});
|
|
316
|
+
describe('on error_stack_1;', () => {
|
|
317
|
+
beforeEach(() => {
|
|
318
|
+
simplified = error_stack_1.getErrorSimplified();
|
|
319
|
+
});
|
|
320
|
+
it('should be defined', () => {
|
|
321
|
+
expect(simplified).toBeDefined();
|
|
322
|
+
});
|
|
323
|
+
it('should have error', () => {
|
|
324
|
+
expect(simplified.error).toBeDefined();
|
|
325
|
+
});
|
|
326
|
+
it('should not have errors', () => {
|
|
327
|
+
expect(simplified.errors).toBeUndefined();
|
|
328
|
+
});
|
|
329
|
+
it('should not have simplified.error.error', () => {
|
|
330
|
+
var _a;
|
|
331
|
+
expect((_a = simplified.error) === null || _a === void 0 ? void 0 : _a.error).toBeUndefined();
|
|
332
|
+
});
|
|
333
|
+
it('should not have simplified.error.errors', () => {
|
|
334
|
+
var _a;
|
|
335
|
+
expect((_a = simplified.error) === null || _a === void 0 ? void 0 : _a.errors).toBeUndefined();
|
|
336
|
+
});
|
|
337
|
+
});
|
|
338
|
+
describe('on error_stack_2;', () => {
|
|
339
|
+
beforeEach(() => {
|
|
340
|
+
simplified = error_stack_2.getErrorSimplified();
|
|
341
|
+
});
|
|
342
|
+
it('should be defined', () => {
|
|
343
|
+
expect(simplified).toBeDefined();
|
|
344
|
+
});
|
|
345
|
+
it('should have error', () => {
|
|
346
|
+
expect(simplified.error).toBeDefined();
|
|
347
|
+
});
|
|
348
|
+
it('should not have errors', () => {
|
|
349
|
+
expect(simplified.errors).toBeUndefined();
|
|
350
|
+
});
|
|
351
|
+
it('should not have simplified.error.error', () => {
|
|
352
|
+
var _a;
|
|
353
|
+
expect((_a = simplified.error) === null || _a === void 0 ? void 0 : _a.error).toBeUndefined();
|
|
354
|
+
});
|
|
355
|
+
it('should not have simplified.error.errors', () => {
|
|
356
|
+
var _a;
|
|
357
|
+
expect((_a = simplified.error) === null || _a === void 0 ? void 0 : _a.errors).toBeUndefined();
|
|
358
|
+
});
|
|
359
|
+
});
|
|
360
|
+
describe('on self defined error;', () => {
|
|
361
|
+
beforeEach(() => {
|
|
362
|
+
simplified = error_selfDefined.getErrorSimplified();
|
|
363
|
+
});
|
|
364
|
+
it('should be defined', () => {
|
|
365
|
+
expect(simplified).toBeDefined();
|
|
366
|
+
});
|
|
367
|
+
it('should have error', () => {
|
|
368
|
+
expect(simplified.error).toBeDefined();
|
|
369
|
+
});
|
|
370
|
+
it('should not have errors', () => {
|
|
371
|
+
expect(simplified.errors).toBeUndefined();
|
|
372
|
+
});
|
|
373
|
+
it('should not have simplified.error.error', () => {
|
|
374
|
+
var _a;
|
|
375
|
+
expect((_a = simplified.error) === null || _a === void 0 ? void 0 : _a.error).toBeUndefined();
|
|
376
|
+
});
|
|
377
|
+
it('should not have simplified.error.errors', () => {
|
|
378
|
+
var _a;
|
|
379
|
+
expect((_a = simplified.error) === null || _a === void 0 ? void 0 : _a.errors).toBeUndefined();
|
|
380
|
+
});
|
|
381
|
+
});
|
|
382
|
+
});
|
|
383
|
+
describe('should have get proper flat;', () => {
|
|
384
|
+
let flat;
|
|
385
|
+
describe('on error_0;', () => {
|
|
386
|
+
beforeEach(() => {
|
|
387
|
+
flat = error_0.getErrorsFlat();
|
|
388
|
+
});
|
|
389
|
+
it('should be defined', () => {
|
|
390
|
+
expect(flat).toBeDefined();
|
|
391
|
+
});
|
|
392
|
+
it('should have error', () => {
|
|
393
|
+
expect(flat.error).toBeDefined();
|
|
394
|
+
});
|
|
395
|
+
describe('errors...;', () => {
|
|
396
|
+
var _a;
|
|
397
|
+
it('should have errors', () => {
|
|
398
|
+
expect(flat === null || flat === void 0 ? void 0 : flat.errors).toBeDefined();
|
|
399
|
+
});
|
|
400
|
+
it('should have 1 errors', () => {
|
|
401
|
+
var _a;
|
|
402
|
+
expect((_a = flat === null || flat === void 0 ? void 0 : flat.errors) === null || _a === void 0 ? void 0 : _a.length).toBe(1);
|
|
403
|
+
});
|
|
404
|
+
(_a = flat === null || flat === void 0 ? void 0 : flat.errors) === null || _a === void 0 ? void 0 : _a.forEach((error, index) => {
|
|
405
|
+
describe(`on error[${index}];`, () => {
|
|
406
|
+
it('should be', () => {
|
|
407
|
+
expect(error).toBeDefined();
|
|
408
|
+
});
|
|
409
|
+
it(`should have error[${index}].error`, () => {
|
|
410
|
+
expect(error.error).toBeDefined();
|
|
411
|
+
});
|
|
412
|
+
it(`should not have error[${index}].errors`, () => {
|
|
413
|
+
expect(error.errors).toBeUndefined();
|
|
414
|
+
});
|
|
415
|
+
it(`should not have error[${index}].error.error`, () => {
|
|
416
|
+
var _a;
|
|
417
|
+
expect((_a = error.error) === null || _a === void 0 ? void 0 : _a.error).toBeUndefined();
|
|
418
|
+
});
|
|
419
|
+
it(`should not have error[${index}].error.errors`, () => {
|
|
420
|
+
var _a;
|
|
421
|
+
expect((_a = error.error) === null || _a === void 0 ? void 0 : _a.errors).toBeUndefined();
|
|
422
|
+
});
|
|
423
|
+
});
|
|
424
|
+
});
|
|
425
|
+
});
|
|
426
|
+
});
|
|
427
|
+
describe('on error_stack_1;', () => {
|
|
428
|
+
beforeEach(() => {
|
|
429
|
+
flat = error_stack_1.getErrorsFlat();
|
|
430
|
+
});
|
|
431
|
+
it('should be defined', () => {
|
|
432
|
+
expect(flat).toBeDefined();
|
|
433
|
+
});
|
|
434
|
+
it('should have error', () => {
|
|
435
|
+
expect(flat.error).toBeDefined();
|
|
436
|
+
});
|
|
437
|
+
describe('errors...;', () => {
|
|
438
|
+
var _a;
|
|
439
|
+
it('should have errors', () => {
|
|
440
|
+
expect(flat === null || flat === void 0 ? void 0 : flat.errors).toBeDefined();
|
|
441
|
+
});
|
|
442
|
+
it('should have 2 errors', () => {
|
|
443
|
+
var _a;
|
|
444
|
+
expect((_a = flat === null || flat === void 0 ? void 0 : flat.errors) === null || _a === void 0 ? void 0 : _a.length).toBe(2);
|
|
445
|
+
});
|
|
446
|
+
(_a = flat === null || flat === void 0 ? void 0 : flat.errors) === null || _a === void 0 ? void 0 : _a.forEach((error, index) => {
|
|
447
|
+
describe(`on error[${index}];`, () => {
|
|
448
|
+
it('should be', () => {
|
|
449
|
+
expect(error).toBeDefined();
|
|
450
|
+
});
|
|
451
|
+
it(`should have error[${index}].error`, () => {
|
|
452
|
+
expect(error.error).toBeDefined();
|
|
453
|
+
});
|
|
454
|
+
it(`should not have error[${index}].errors`, () => {
|
|
455
|
+
expect(error.errors).toBeUndefined();
|
|
456
|
+
});
|
|
457
|
+
it('should not have error[${index}].error.error', () => {
|
|
458
|
+
var _a;
|
|
459
|
+
expect((_a = error.error) === null || _a === void 0 ? void 0 : _a.error).toBeUndefined();
|
|
460
|
+
});
|
|
461
|
+
it('should not have error[${index}].error.errors', () => {
|
|
462
|
+
var _a;
|
|
463
|
+
expect((_a = error.error) === null || _a === void 0 ? void 0 : _a.errors).toBeUndefined();
|
|
464
|
+
});
|
|
465
|
+
});
|
|
466
|
+
});
|
|
467
|
+
});
|
|
468
|
+
});
|
|
469
|
+
describe('on error_stack_2;', () => {
|
|
470
|
+
beforeEach(() => {
|
|
471
|
+
flat = error_stack_2.getErrorsFlat();
|
|
472
|
+
});
|
|
473
|
+
it('should be defined', () => {
|
|
474
|
+
expect(flat).toBeDefined();
|
|
475
|
+
});
|
|
476
|
+
it('should have error', () => {
|
|
477
|
+
expect(flat.error).toBeDefined();
|
|
478
|
+
});
|
|
479
|
+
describe('errors...;', () => {
|
|
480
|
+
var _a;
|
|
481
|
+
it('should have errors', () => {
|
|
482
|
+
expect(flat === null || flat === void 0 ? void 0 : flat.errors).toBeDefined();
|
|
483
|
+
});
|
|
484
|
+
it('should have 3 errors', () => {
|
|
485
|
+
var _a;
|
|
486
|
+
expect((_a = flat === null || flat === void 0 ? void 0 : flat.errors) === null || _a === void 0 ? void 0 : _a.length).toBe(3);
|
|
487
|
+
});
|
|
488
|
+
(_a = flat === null || flat === void 0 ? void 0 : flat.errors) === null || _a === void 0 ? void 0 : _a.forEach((error, index) => {
|
|
489
|
+
describe(`on error[${index}];`, () => {
|
|
490
|
+
it('should be', () => {
|
|
491
|
+
expect(error).toBeDefined();
|
|
492
|
+
});
|
|
493
|
+
it(`should have error[${index}].error`, () => {
|
|
494
|
+
expect(error.error).toBeDefined();
|
|
495
|
+
});
|
|
496
|
+
it(`should not have error[${index}].errors`, () => {
|
|
497
|
+
expect(error.errors).toBeUndefined();
|
|
498
|
+
});
|
|
499
|
+
it(`should not have error[${index}].error.error`, () => {
|
|
500
|
+
var _a;
|
|
501
|
+
expect((_a = error.error) === null || _a === void 0 ? void 0 : _a.error).toBeUndefined();
|
|
502
|
+
});
|
|
503
|
+
it(`should not have error[${index}].error.errors`, () => {
|
|
504
|
+
var _a;
|
|
505
|
+
expect((_a = error.error) === null || _a === void 0 ? void 0 : _a.errors).toBeUndefined();
|
|
506
|
+
});
|
|
507
|
+
});
|
|
508
|
+
});
|
|
509
|
+
});
|
|
510
|
+
});
|
|
511
|
+
describe('on self defined error;', () => {
|
|
512
|
+
beforeEach(() => {
|
|
513
|
+
flat = error_selfDefined.getErrorsFlat();
|
|
514
|
+
});
|
|
515
|
+
it('should be defined', () => {
|
|
516
|
+
expect(flat).toBeDefined();
|
|
517
|
+
});
|
|
518
|
+
it('should have error', () => {
|
|
519
|
+
expect(flat.error).toBeDefined();
|
|
520
|
+
});
|
|
521
|
+
describe('errors...;', () => {
|
|
522
|
+
var _a;
|
|
523
|
+
it('should have errors', () => {
|
|
524
|
+
expect(flat === null || flat === void 0 ? void 0 : flat.errors).toBeDefined();
|
|
525
|
+
});
|
|
526
|
+
it('should have 1 errors', () => {
|
|
527
|
+
var _a;
|
|
528
|
+
expect((_a = flat === null || flat === void 0 ? void 0 : flat.errors) === null || _a === void 0 ? void 0 : _a.length).toBe(1);
|
|
529
|
+
});
|
|
530
|
+
(_a = flat === null || flat === void 0 ? void 0 : flat.errors) === null || _a === void 0 ? void 0 : _a.forEach((error, index) => {
|
|
531
|
+
describe(`on error[${index}];`, () => {
|
|
532
|
+
it('should be', () => {
|
|
533
|
+
expect(error).toBeDefined();
|
|
534
|
+
});
|
|
535
|
+
it(`should have error[${index}].error`, () => {
|
|
536
|
+
expect(error.error).toBeDefined();
|
|
537
|
+
});
|
|
538
|
+
it(`should not have error[${index}].errors`, () => {
|
|
539
|
+
expect(error.errors).toBeUndefined();
|
|
540
|
+
});
|
|
541
|
+
it(`should not have error[${index}].error.error`, () => {
|
|
542
|
+
var _a;
|
|
543
|
+
expect((_a = error.error) === null || _a === void 0 ? void 0 : _a.error).toBeUndefined();
|
|
544
|
+
});
|
|
545
|
+
it(`should not have error[${index}].error.errors`, () => {
|
|
546
|
+
var _a;
|
|
547
|
+
expect((_a = error.error) === null || _a === void 0 ? void 0 : _a.errors).toBeUndefined();
|
|
548
|
+
});
|
|
549
|
+
});
|
|
550
|
+
});
|
|
551
|
+
});
|
|
552
|
+
});
|
|
553
|
+
});
|
|
271
554
|
});
|
|
272
555
|
//# sourceMappingURL=error.control-model.spec.js.map
|