@futdevpro/fsm-dynamo 1.5.60 → 1.5.61
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 +40 -21
- package/lib/_models/control-models/error.control-model.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/_models/control-models/error.control-model.ts +28 -6
|
@@ -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,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,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Dynamo_Error extends metadata_data_model_1.Dynamo_Metadata {
|
|
8
8
|
constructor(set) {
|
|
9
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13;
|
|
9
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14;
|
|
10
10
|
super(set, { issuer: (_c = (_a = set === null || set === void 0 ? void 0 : set.issuerService) !== null && _a !== void 0 ? _a : (_b = set === null || set === void 0 ? void 0 : set.error) === null || _b === void 0 ? void 0 : _b.___issuerService) !== null && _c !== void 0 ? _c : error_defaults_const_1.dynamo_error_default.issuerService });
|
|
11
11
|
this.flag = 'DYNAMO-ERROR-OBJECT-v2';
|
|
12
12
|
this._errorCodes = [];
|
|
@@ -37,33 +37,41 @@ class Dynamo_Error extends metadata_data_model_1.Dynamo_Metadata {
|
|
|
37
37
|
set.errorCode = error_defaults_const_1.dynamo_error_default.errorCode;
|
|
38
38
|
}
|
|
39
39
|
this._errorCodes = [...previousErrorCodes, set === null || set === void 0 ? void 0 : set.errorCode].filter(Boolean);
|
|
40
|
-
|
|
40
|
+
/** bring up non NTS and non default first error */
|
|
41
|
+
const filteredErrorCodes = this._errorCodes.filter((code) => code && code !== error_defaults_const_1.dynamo_error_default.errorCode && !code.includes('NTS-'));
|
|
42
|
+
this._errorCode = (_u = filteredErrorCodes[0]) !== null && _u !== void 0 ? _u : (_v = this._errorCodes) === null || _v === void 0 ? void 0 : _v[0];
|
|
43
|
+
const highlightedErrorCodeIndex = this._errorCodes.findIndex(code => code === (filteredErrorCodes === null || filteredErrorCodes === void 0 ? void 0 : filteredErrorCodes[0]));
|
|
41
44
|
/** set message */
|
|
42
45
|
if (!set.message) {
|
|
43
46
|
/** simple - non-dynamo - error */
|
|
44
|
-
if (!((
|
|
45
|
-
set.message = (
|
|
47
|
+
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
|
+
set.message = (_z = set === null || set === void 0 ? void 0 : set.error) === null || _z === void 0 ? void 0 : _z.message;
|
|
46
49
|
}
|
|
47
50
|
else {
|
|
48
51
|
/** error not defined */
|
|
49
|
-
const posFull = (
|
|
52
|
+
const posFull = (_1 = (_0 = new Error().stack.split('\n')) === null || _0 === void 0 ? void 0 : _0[2]) === null || _1 === void 0 ? void 0 : _1.split('\\');
|
|
50
53
|
set.message = error_defaults_const_1.dynamo_error_default.message + '; ' + posFull[posFull.length - 1];
|
|
51
54
|
}
|
|
52
55
|
}
|
|
53
56
|
/** set messages */
|
|
54
57
|
const previousMessages = [];
|
|
55
|
-
if ((
|
|
56
|
-
previousMessages.push(...(
|
|
58
|
+
if ((_2 = set === null || set === void 0 ? void 0 : set.error) === null || _2 === void 0 ? void 0 : _2._messages) {
|
|
59
|
+
previousMessages.push(...(_3 = set === null || set === void 0 ? void 0 : set.error) === null || _3 === void 0 ? void 0 : _3._messages);
|
|
57
60
|
}
|
|
58
|
-
else if ((
|
|
59
|
-
previousErrorCodes.push((
|
|
61
|
+
else if ((_4 = set === null || set === void 0 ? void 0 : set.error) === null || _4 === void 0 ? void 0 : _4.message) {
|
|
62
|
+
previousErrorCodes.push((_5 = set === null || set === void 0 ? void 0 : set.error) === null || _5 === void 0 ? void 0 : _5.message);
|
|
60
63
|
}
|
|
61
64
|
this._messages = [...previousMessages, set === null || set === void 0 ? void 0 : set.message,].filter(Boolean);
|
|
62
|
-
|
|
65
|
+
if (-1 < highlightedErrorCodeIndex && this._messages[highlightedErrorCodeIndex]) {
|
|
66
|
+
this._message = this._messages[highlightedErrorCodeIndex];
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
this._message = (_6 = this._messages) === null || _6 === void 0 ? void 0 : _6[0];
|
|
70
|
+
}
|
|
63
71
|
/** set userMessages */
|
|
64
72
|
const previousUserMessages = [];
|
|
65
|
-
if ((
|
|
66
|
-
previousUserMessages.push(...(
|
|
73
|
+
if ((_7 = set === null || set === void 0 ? void 0 : set.error) === null || _7 === void 0 ? void 0 : _7.__userMessages) {
|
|
74
|
+
previousUserMessages.push(...(_8 = set === null || set === void 0 ? void 0 : set.error) === null || _8 === void 0 ? void 0 : _8.__userMessages);
|
|
67
75
|
}
|
|
68
76
|
if (!set.userMessage) {
|
|
69
77
|
set.userMessage = error_defaults_const_1.dynamo_error_default.userMessage;
|
|
@@ -72,16 +80,21 @@ class Dynamo_Error extends metadata_data_model_1.Dynamo_Metadata {
|
|
|
72
80
|
set.userMessage += `\nErrorCode: ${set.errorCode}`;
|
|
73
81
|
}
|
|
74
82
|
this.__userMessages = [...previousUserMessages, set === null || set === void 0 ? void 0 : set.userMessage].filter(Boolean);
|
|
75
|
-
|
|
83
|
+
if (-1 < highlightedErrorCodeIndex && this.__userMessages[highlightedErrorCodeIndex]) {
|
|
84
|
+
this.__userMessage = this.__userMessages[highlightedErrorCodeIndex];
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
this.__userMessage = (_9 = this.__userMessages.filter((msg) => msg && msg !== error_defaults_const_1.dynamo_error_default.userMessage)) === null || _9 === void 0 ? void 0 : _9[0];
|
|
88
|
+
}
|
|
76
89
|
/** set errors */
|
|
77
90
|
const previousErrors = [];
|
|
78
|
-
if ((
|
|
79
|
-
previousErrors.push(...(
|
|
91
|
+
if ((_10 = set === null || set === void 0 ? void 0 : set.error) === null || _10 === void 0 ? void 0 : _10.errors) {
|
|
92
|
+
previousErrors.push(...(_11 = set === null || set === void 0 ? void 0 : set.error) === null || _11 === void 0 ? void 0 : _11.errors);
|
|
80
93
|
}
|
|
81
94
|
this.errors = [...previousErrors, set === null || set === void 0 ? void 0 : set.error].filter(Boolean);
|
|
82
|
-
this.error = (
|
|
95
|
+
this.error = (_12 = this.errors) === null || _12 === void 0 ? void 0 : _12[0];
|
|
83
96
|
if (set === null || set === void 0 ? void 0 : set.modestLog) {
|
|
84
|
-
console.error((
|
|
97
|
+
console.error((_14 = (_13 = this._message) !== null && _13 !== void 0 ? _13 : this.__userMessage) !== null && _14 !== void 0 ? _14 : this.error);
|
|
85
98
|
}
|
|
86
99
|
if (set === null || set === void 0 ? void 0 : set.log) {
|
|
87
100
|
console.error(this);
|
|
@@ -93,24 +106,30 @@ class Dynamo_Error extends metadata_data_model_1.Dynamo_Metadata {
|
|
|
93
106
|
}
|
|
94
107
|
}
|
|
95
108
|
getErrorSimplified() {
|
|
96
|
-
var _a;
|
|
97
|
-
const error = this;
|
|
109
|
+
var _a, _b;
|
|
110
|
+
const error = Object.assign({}, this);
|
|
98
111
|
delete error.errors;
|
|
99
112
|
if ((_a = error.error) === null || _a === void 0 ? void 0 : _a.errors) {
|
|
100
113
|
delete error.error.errors;
|
|
101
114
|
}
|
|
115
|
+
if ((_b = error.error) === null || _b === void 0 ? void 0 : _b.error) {
|
|
116
|
+
delete error.error.error;
|
|
117
|
+
}
|
|
102
118
|
return error;
|
|
103
119
|
}
|
|
104
120
|
getErrorsFlat() {
|
|
105
|
-
const error = this;
|
|
121
|
+
const error = Object.assign({}, this);
|
|
106
122
|
error.errors.forEach((err) => {
|
|
107
|
-
var _a;
|
|
123
|
+
var _a, _b;
|
|
108
124
|
if (err.errors) {
|
|
109
125
|
delete err.errors;
|
|
110
126
|
}
|
|
111
127
|
if ((_a = err.error) === null || _a === void 0 ? void 0 : _a.errors) {
|
|
112
128
|
delete err.error.errors;
|
|
113
129
|
}
|
|
130
|
+
if ((_b = err.error) === null || _b === void 0 ? void 0 : _b.error) {
|
|
131
|
+
delete err.error.error;
|
|
132
|
+
}
|
|
114
133
|
});
|
|
115
134
|
return error;
|
|
116
135
|
}
|
|
@@ -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;YAExE,IAAI,CAAC,SAAS,eAAG,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,MAAM,yCAAK,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,KAAsB,0CAAE,SAAS,mCAAI,2CAAoB,CAAC,MAAM,CAAC;YACvG,IAAI,CAAC,eAAe,eAAG,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,YAAY,yCAAK,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,KAAsB,0CAAE,eAAe,mCAAI,2CAAoB,CAAC,YAAY,CAAC;YAC/H,IAAI,CAAC,gBAAgB,eAAG,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,aAAa,yCAAK,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,KAAsB,0CAAE,gBAAgB,mCAAI,2CAAoB,CAAC,aAAa,CAAC;YAEnI,6BAA6B;YAC7B,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE;gBAClB,GAAG,CAAC,SAAS,GAAG,2CAAoB,CAAC,SAAS,CAAC;aAChD;YAED,qBAAqB;YACrB,MAAM,kBAAkB,GAAa,EAAE,CAAC;YACxC,UAAK,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,KAAsB,0CAAE,WAAW,EAAE;gBAC7C,kBAAkB,CAAC,IAAI,CAAC,SAAI,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,KAAsB,0CAAE,WAAW,CAAC,CAAC;aACvE;YACD,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE;gBAClB,GAAG,CAAC,SAAS,GAAG,2CAAoB,CAAC,SAAS,CAAC;aAChD;YACD,IAAI,CAAC,WAAW,GAAG,CAAE,GAAG,kBAAkB,EAAE,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,SAAS,CAAE,CAAC,MAAM,CAAC,OAAO,CAAC,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,CAA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IAAI,GAAG,CAAC,MAAM,EAAE;gBACd,OAAO,GAAG,CAAC,MAAM,CAAC;aACnB;YAED,UAAK,GAAG,CAAC,KAAsB,0CAAE,MAAM,EAAE;gBACvC,OAAQ,GAAG,CAAC,KAAsB,CAAC,MAAM,CAAC;aAC3C;YACD,UAAK,GAAG,CAAC,KAAsB,0CAAE,KAAK,EAAE;gBACtC,OAAQ,GAAG,CAAC,KAAsB,CAAC,KAAK,CAAC;aAC1C;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAhMD,oCAgMC"}
|
package/lib/tsconfig.tsbuildinfo
CHANGED
|
@@ -367,7 +367,7 @@
|
|
|
367
367
|
"affectsGlobalScope": false
|
|
368
368
|
},
|
|
369
369
|
"../src/_models/control-models/error.control-model.ts": {
|
|
370
|
-
"version": "
|
|
370
|
+
"version": "4c6e64fe7f9a6701e7c49595216cb673859207790c7ea257ef7365286e7f9a71",
|
|
371
371
|
"signature": "f793e34d7b18443997cc64e3b850c1ea2b9813a60f14dc770d4a4eaabc8d2f1c",
|
|
372
372
|
"affectsGlobalScope": false
|
|
373
373
|
},
|
package/package.json
CHANGED
|
@@ -85,7 +85,13 @@ export class Dynamo_Error extends Dynamo_Metadata {
|
|
|
85
85
|
set.errorCode = dynamo_error_default.errorCode;
|
|
86
86
|
}
|
|
87
87
|
this._errorCodes = [ ...previousErrorCodes, set?.errorCode ].filter(Boolean);
|
|
88
|
-
|
|
88
|
+
|
|
89
|
+
/** bring up non NTS and non default first error */
|
|
90
|
+
const filteredErrorCodes: string[] = this._errorCodes.filter(
|
|
91
|
+
(code: string) => code && code !== dynamo_error_default.errorCode && !code.includes('NTS-')
|
|
92
|
+
);
|
|
93
|
+
this._errorCode = filteredErrorCodes[0] ?? this._errorCodes?.[0];
|
|
94
|
+
const highlightedErrorCodeIndex: number = this._errorCodes.findIndex(code => code === filteredErrorCodes?.[0]);
|
|
89
95
|
|
|
90
96
|
/** set message */
|
|
91
97
|
if (!set.message) {
|
|
@@ -106,7 +112,11 @@ export class Dynamo_Error extends Dynamo_Metadata {
|
|
|
106
112
|
previousErrorCodes.push((set?.error as Error)?.message);
|
|
107
113
|
}
|
|
108
114
|
this._messages = [ ...previousMessages, set?.message, ].filter(Boolean);
|
|
109
|
-
|
|
115
|
+
if (-1 < highlightedErrorCodeIndex && this._messages[highlightedErrorCodeIndex]) {
|
|
116
|
+
this._message = this._messages[highlightedErrorCodeIndex];
|
|
117
|
+
} else {
|
|
118
|
+
this._message = this._messages?.[0];
|
|
119
|
+
}
|
|
110
120
|
|
|
111
121
|
/** set userMessages */
|
|
112
122
|
const previousUserMessages: string[] = [];
|
|
@@ -120,7 +130,13 @@ export class Dynamo_Error extends Dynamo_Metadata {
|
|
|
120
130
|
set.userMessage += `\nErrorCode: ${set.errorCode}`
|
|
121
131
|
}
|
|
122
132
|
this.__userMessages = [ ...previousUserMessages, set?.userMessage ].filter(Boolean);
|
|
123
|
-
|
|
133
|
+
if (-1 < highlightedErrorCodeIndex && this.__userMessages[highlightedErrorCodeIndex]) {
|
|
134
|
+
this.__userMessage = this.__userMessages[highlightedErrorCodeIndex];
|
|
135
|
+
} else {
|
|
136
|
+
this.__userMessage = this.__userMessages.filter(
|
|
137
|
+
(msg: string) => msg && msg !== dynamo_error_default.userMessage
|
|
138
|
+
)?.[0];
|
|
139
|
+
}
|
|
124
140
|
|
|
125
141
|
/** set errors */
|
|
126
142
|
const previousErrors: (Error | Dynamo_Error)[] = [];
|
|
@@ -148,28 +164,34 @@ export class Dynamo_Error extends Dynamo_Metadata {
|
|
|
148
164
|
}
|
|
149
165
|
|
|
150
166
|
getErrorSimplified(): Dynamo_Error {
|
|
151
|
-
const error = this;
|
|
167
|
+
const error = { ...this };
|
|
152
168
|
|
|
153
169
|
delete error.errors;
|
|
154
170
|
|
|
155
171
|
if ((error.error as Dynamo_Error)?.errors) {
|
|
156
172
|
delete (error.error as Dynamo_Error).errors;
|
|
157
173
|
}
|
|
174
|
+
if ((error.error as Dynamo_Error)?.error) {
|
|
175
|
+
delete (error.error as Dynamo_Error).error;
|
|
176
|
+
}
|
|
158
177
|
|
|
159
178
|
return error;
|
|
160
179
|
}
|
|
161
180
|
|
|
162
181
|
getErrorsFlat(): Dynamo_Error {
|
|
163
|
-
const error = this;
|
|
182
|
+
const error = { ...this };
|
|
164
183
|
|
|
165
184
|
error.errors.forEach((err: Dynamo_Error) => {
|
|
166
185
|
if (err.errors) {
|
|
167
186
|
delete err.errors;
|
|
168
187
|
}
|
|
169
|
-
|
|
188
|
+
|
|
170
189
|
if ((err.error as Dynamo_Error)?.errors) {
|
|
171
190
|
delete (err.error as Dynamo_Error).errors;
|
|
172
191
|
}
|
|
192
|
+
if ((err.error as Dynamo_Error)?.error) {
|
|
193
|
+
delete (err.error as Dynamo_Error).error;
|
|
194
|
+
}
|
|
173
195
|
});
|
|
174
196
|
|
|
175
197
|
return error;
|