@smbcheeky/error-object-from-payload 1.1.9 → 1.2.0
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/dist/index.js +12 -12
- package/dist/index.mjs +12 -12
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -411,7 +411,7 @@ var _ErrorObjectFromPayload = class _ErrorObjectFromPayload extends import_error
|
|
|
411
411
|
} catch (error) {
|
|
412
412
|
super({
|
|
413
413
|
code: "INT-1",
|
|
414
|
-
message: `Error during checkInputForInitialObject(). Details: ${(_b = (_a = error == null ? void 0 : error.toString) == null ? void 0 : _a.call(error)) != null ? _b : import_error_object2.ErrorObject.
|
|
414
|
+
message: `Error during checkInputForInitialObject(). Details: ${(_b = (_a = error == null ? void 0 : error.toString) == null ? void 0 : _a.call(error)) != null ? _b : import_error_object2.ErrorObject.GENERIC_MESSAGE}}`,
|
|
415
415
|
tag: _ErrorObjectFromPayload.DEFAULT_FALLBACK_TAG,
|
|
416
416
|
raw: {
|
|
417
417
|
error
|
|
@@ -421,8 +421,8 @@ var _ErrorObjectFromPayload = class _ErrorObjectFromPayload extends import_error
|
|
|
421
421
|
}
|
|
422
422
|
if (checksFailed !== void 0) {
|
|
423
423
|
super({
|
|
424
|
-
code:
|
|
425
|
-
message:
|
|
424
|
+
code: import_error_object2.ErrorObject.GENERIC_CODE,
|
|
425
|
+
message: import_error_object2.ErrorObject.GENERIC_MESSAGE,
|
|
426
426
|
tag: _ErrorObjectFromPayload.DEFAULT_FALLBACK_TAG,
|
|
427
427
|
raw: {
|
|
428
428
|
processingErrors: [{ errorCode: checksFailed, summary: void 0 }]
|
|
@@ -453,8 +453,8 @@ var _ErrorObjectFromPayload = class _ErrorObjectFromPayload extends import_error
|
|
|
453
453
|
}
|
|
454
454
|
}
|
|
455
455
|
super({
|
|
456
|
-
code:
|
|
457
|
-
message:
|
|
456
|
+
code: import_error_object2.ErrorObject.GENERIC_CODE,
|
|
457
|
+
message: import_error_object2.ErrorObject.GENERIC_MESSAGE,
|
|
458
458
|
tag: _ErrorObjectFromPayload.DEFAULT_FALLBACK_TAG,
|
|
459
459
|
raw: {
|
|
460
460
|
processingErrors: processingErrors.length > 0 ? processingErrors : void 0,
|
|
@@ -464,7 +464,7 @@ var _ErrorObjectFromPayload = class _ErrorObjectFromPayload extends import_error
|
|
|
464
464
|
} catch (error) {
|
|
465
465
|
super({
|
|
466
466
|
code: "INT-2",
|
|
467
|
-
message: `Error during processErrorObjectResult(). Details: ${(_d = (_c = error == null ? void 0 : error.toString) == null ? void 0 : _c.call(error)) != null ? _d : import_error_object2.ErrorObject.
|
|
467
|
+
message: `Error during processErrorObjectResult(). Details: ${(_d = (_c = error == null ? void 0 : error.toString) == null ? void 0 : _c.call(error)) != null ? _d : import_error_object2.ErrorObject.GENERIC_MESSAGE}}`,
|
|
468
468
|
tag: _ErrorObjectFromPayload.DEFAULT_FALLBACK_TAG,
|
|
469
469
|
raw: {
|
|
470
470
|
error
|
|
@@ -477,16 +477,16 @@ var _ErrorObjectFromPayload = class _ErrorObjectFromPayload extends import_error
|
|
|
477
477
|
const logForThis = logLevel === "verbose" ? this.toVerboseString() : logLevel === "debug" ? this.toDebugString() : this.toString();
|
|
478
478
|
if (Array.isArray(this.nextErrors) && this.nextErrors.length > 0) {
|
|
479
479
|
let row = 1;
|
|
480
|
-
|
|
480
|
+
import_error_object2.ErrorObject.LOG_METHOD && typeof import_error_object2.ErrorObject.LOG_METHOD === "function" && import_error_object2.ErrorObject.LOG_METHOD(`[${logTag}][${row}]`, logForThis);
|
|
481
481
|
for (const error of this.nextErrors) {
|
|
482
482
|
row++;
|
|
483
|
-
|
|
483
|
+
import_error_object2.ErrorObject.LOG_METHOD && typeof import_error_object2.ErrorObject.LOG_METHOD === "function" && import_error_object2.ErrorObject.LOG_METHOD(
|
|
484
484
|
`[${logTag}][${row}]`,
|
|
485
485
|
logLevel === "verbose" ? error.toVerboseString() : logLevel === "debug" ? error.toDebugString() : error.toString()
|
|
486
486
|
);
|
|
487
487
|
}
|
|
488
488
|
} else {
|
|
489
|
-
|
|
489
|
+
import_error_object2.ErrorObject.LOG_METHOD && typeof import_error_object2.ErrorObject.LOG_METHOD === "function" && import_error_object2.ErrorObject.LOG_METHOD(`[${logTag}]`, logForThis);
|
|
490
490
|
}
|
|
491
491
|
return this;
|
|
492
492
|
}
|
|
@@ -621,9 +621,9 @@ ${JSON.stringify(
|
|
|
621
621
|
_ErrorObjectFromPayload.DEFAULT_FALLBACK_TAG = "fallback-error-object";
|
|
622
622
|
// Overrides
|
|
623
623
|
_ErrorObjectFromPayload.generic = () => new _ErrorObjectFromPayload({
|
|
624
|
-
code: import_error_object2.ErrorObject.
|
|
625
|
-
message: import_error_object2.ErrorObject.
|
|
626
|
-
tag: import_error_object2.ErrorObject.
|
|
624
|
+
code: import_error_object2.ErrorObject.GENERIC_CODE,
|
|
625
|
+
message: import_error_object2.ErrorObject.GENERIC_MESSAGE,
|
|
626
|
+
tag: import_error_object2.ErrorObject.GENERIC_TAG
|
|
627
627
|
});
|
|
628
628
|
var ErrorObjectFromPayload = _ErrorObjectFromPayload;
|
|
629
629
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.mjs
CHANGED
|
@@ -388,7 +388,7 @@ var _ErrorObjectFromPayload = class _ErrorObjectFromPayload extends ErrorObject2
|
|
|
388
388
|
} catch (error) {
|
|
389
389
|
super({
|
|
390
390
|
code: "INT-1",
|
|
391
|
-
message: `Error during checkInputForInitialObject(). Details: ${(_b = (_a = error == null ? void 0 : error.toString) == null ? void 0 : _a.call(error)) != null ? _b : ErrorObject2.
|
|
391
|
+
message: `Error during checkInputForInitialObject(). Details: ${(_b = (_a = error == null ? void 0 : error.toString) == null ? void 0 : _a.call(error)) != null ? _b : ErrorObject2.GENERIC_MESSAGE}}`,
|
|
392
392
|
tag: _ErrorObjectFromPayload.DEFAULT_FALLBACK_TAG,
|
|
393
393
|
raw: {
|
|
394
394
|
error
|
|
@@ -398,8 +398,8 @@ var _ErrorObjectFromPayload = class _ErrorObjectFromPayload extends ErrorObject2
|
|
|
398
398
|
}
|
|
399
399
|
if (checksFailed !== void 0) {
|
|
400
400
|
super({
|
|
401
|
-
code:
|
|
402
|
-
message:
|
|
401
|
+
code: ErrorObject2.GENERIC_CODE,
|
|
402
|
+
message: ErrorObject2.GENERIC_MESSAGE,
|
|
403
403
|
tag: _ErrorObjectFromPayload.DEFAULT_FALLBACK_TAG,
|
|
404
404
|
raw: {
|
|
405
405
|
processingErrors: [{ errorCode: checksFailed, summary: void 0 }]
|
|
@@ -430,8 +430,8 @@ var _ErrorObjectFromPayload = class _ErrorObjectFromPayload extends ErrorObject2
|
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
432
|
super({
|
|
433
|
-
code:
|
|
434
|
-
message:
|
|
433
|
+
code: ErrorObject2.GENERIC_CODE,
|
|
434
|
+
message: ErrorObject2.GENERIC_MESSAGE,
|
|
435
435
|
tag: _ErrorObjectFromPayload.DEFAULT_FALLBACK_TAG,
|
|
436
436
|
raw: {
|
|
437
437
|
processingErrors: processingErrors.length > 0 ? processingErrors : void 0,
|
|
@@ -441,7 +441,7 @@ var _ErrorObjectFromPayload = class _ErrorObjectFromPayload extends ErrorObject2
|
|
|
441
441
|
} catch (error) {
|
|
442
442
|
super({
|
|
443
443
|
code: "INT-2",
|
|
444
|
-
message: `Error during processErrorObjectResult(). Details: ${(_d = (_c = error == null ? void 0 : error.toString) == null ? void 0 : _c.call(error)) != null ? _d : ErrorObject2.
|
|
444
|
+
message: `Error during processErrorObjectResult(). Details: ${(_d = (_c = error == null ? void 0 : error.toString) == null ? void 0 : _c.call(error)) != null ? _d : ErrorObject2.GENERIC_MESSAGE}}`,
|
|
445
445
|
tag: _ErrorObjectFromPayload.DEFAULT_FALLBACK_TAG,
|
|
446
446
|
raw: {
|
|
447
447
|
error
|
|
@@ -454,16 +454,16 @@ var _ErrorObjectFromPayload = class _ErrorObjectFromPayload extends ErrorObject2
|
|
|
454
454
|
const logForThis = logLevel === "verbose" ? this.toVerboseString() : logLevel === "debug" ? this.toDebugString() : this.toString();
|
|
455
455
|
if (Array.isArray(this.nextErrors) && this.nextErrors.length > 0) {
|
|
456
456
|
let row = 1;
|
|
457
|
-
|
|
457
|
+
ErrorObject2.LOG_METHOD && typeof ErrorObject2.LOG_METHOD === "function" && ErrorObject2.LOG_METHOD(`[${logTag}][${row}]`, logForThis);
|
|
458
458
|
for (const error of this.nextErrors) {
|
|
459
459
|
row++;
|
|
460
|
-
|
|
460
|
+
ErrorObject2.LOG_METHOD && typeof ErrorObject2.LOG_METHOD === "function" && ErrorObject2.LOG_METHOD(
|
|
461
461
|
`[${logTag}][${row}]`,
|
|
462
462
|
logLevel === "verbose" ? error.toVerboseString() : logLevel === "debug" ? error.toDebugString() : error.toString()
|
|
463
463
|
);
|
|
464
464
|
}
|
|
465
465
|
} else {
|
|
466
|
-
|
|
466
|
+
ErrorObject2.LOG_METHOD && typeof ErrorObject2.LOG_METHOD === "function" && ErrorObject2.LOG_METHOD(`[${logTag}]`, logForThis);
|
|
467
467
|
}
|
|
468
468
|
return this;
|
|
469
469
|
}
|
|
@@ -598,9 +598,9 @@ ${JSON.stringify(
|
|
|
598
598
|
_ErrorObjectFromPayload.DEFAULT_FALLBACK_TAG = "fallback-error-object";
|
|
599
599
|
// Overrides
|
|
600
600
|
_ErrorObjectFromPayload.generic = () => new _ErrorObjectFromPayload({
|
|
601
|
-
code: ErrorObject2.
|
|
602
|
-
message: ErrorObject2.
|
|
603
|
-
tag: ErrorObject2.
|
|
601
|
+
code: ErrorObject2.GENERIC_CODE,
|
|
602
|
+
message: ErrorObject2.GENERIC_MESSAGE,
|
|
603
|
+
tag: ErrorObject2.GENERIC_TAG
|
|
604
604
|
});
|
|
605
605
|
var ErrorObjectFromPayload = _ErrorObjectFromPayload;
|
|
606
606
|
export {
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smbcheeky/error-object-from-payload",
|
|
3
3
|
"description": "Create ErrorObjects from any payload with simple rules and benefit from step-to-step debugging logs for the entire process.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.2.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"build": "tsup src/index.ts --format cjs,esm --dts",
|
|
10
10
|
"pack": "yarn build && npm pack",
|
|
11
|
-
"release": "yarn build && npm publish --access public",
|
|
11
|
+
"release": "yarn build && npm login && npm publish --access public",
|
|
12
12
|
"lint": "tsc --noEmit"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@smbcheeky/error-object": "1.
|
|
15
|
+
"@smbcheeky/error-object": "1.2.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"tsup": "8.3.5",
|