@jakubmazanec/error 3.0.5-unstable.91147a2 → 3.0.5-unstable.bd4a116
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.
|
@@ -2,7 +2,7 @@ import { type UNKNOWN_ERROR } from '../constants.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* Type representing custom error.
|
|
4
4
|
*/
|
|
5
|
-
export type CustomError<ErrorCode extends string> = {
|
|
5
|
+
export type CustomError<ErrorCode extends string> = Error & {
|
|
6
6
|
/** String that is used to quickly determine the nature of the error and why it could have occurred. */
|
|
7
7
|
code: ErrorCode | typeof UNKNOWN_ERROR;
|
|
8
|
-
}
|
|
8
|
+
};
|
|
@@ -2,9 +2,9 @@ import { type UNKNOWN_ERROR } from '../constants.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* Type representing custom error that can have an arbitrary data attached.
|
|
4
4
|
*/
|
|
5
|
-
export type CustomErrorWithData<ErrorCode extends string, ErrorData> = {
|
|
5
|
+
export type CustomErrorWithData<ErrorCode extends string, ErrorData> = Error & {
|
|
6
6
|
/** String that is used to quickly determine the nature of the error and why it could have occurred. */
|
|
7
7
|
code: ErrorCode | typeof UNKNOWN_ERROR;
|
|
8
8
|
/** Data related to the error that can be used during the error handling process to gain more information or take an action. */
|
|
9
9
|
data?: ErrorData;
|
|
10
|
-
}
|
|
10
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jakubmazanec/error",
|
|
3
|
-
"version": "3.0.5-unstable.
|
|
3
|
+
"version": "3.0.5-unstable.bd4a116",
|
|
4
4
|
"description": "Collection of utilities for creating and handling errors.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"zod": "^3.23.8"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@jakubmazanec/eslint-config": "4.0.0-unstable.
|
|
33
|
+
"@jakubmazanec/eslint-config": "4.0.0-unstable.bd4a116",
|
|
34
34
|
"@types/lodash": "^4.17.13",
|
|
35
35
|
"@types/node": "^22.9.0",
|
|
36
36
|
"@vitest/coverage-v8": "^2.1.4",
|
|
@@ -3,7 +3,7 @@ import {type UNKNOWN_ERROR} from '../constants.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Type representing custom error.
|
|
5
5
|
*/
|
|
6
|
-
export type CustomError<ErrorCode extends string> = {
|
|
6
|
+
export type CustomError<ErrorCode extends string> = Error & {
|
|
7
7
|
/** String that is used to quickly determine the nature of the error and why it could have occurred. */
|
|
8
8
|
code: ErrorCode | typeof UNKNOWN_ERROR;
|
|
9
|
-
}
|
|
9
|
+
};
|
|
@@ -3,10 +3,10 @@ import {type UNKNOWN_ERROR} from '../constants.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Type representing custom error that can have an arbitrary data attached.
|
|
5
5
|
*/
|
|
6
|
-
export type CustomErrorWithData<ErrorCode extends string, ErrorData> = {
|
|
6
|
+
export type CustomErrorWithData<ErrorCode extends string, ErrorData> = Error & {
|
|
7
7
|
/** String that is used to quickly determine the nature of the error and why it could have occurred. */
|
|
8
8
|
code: ErrorCode | typeof UNKNOWN_ERROR;
|
|
9
9
|
|
|
10
10
|
/** Data related to the error that can be used during the error handling process to gain more information or take an action. */
|
|
11
11
|
data?: ErrorData;
|
|
12
|
-
}
|
|
12
|
+
};
|