@exodus/errors 3.5.0 → 3.6.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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.6.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/errors@3.5.0...@exodus/errors@3.6.0) (2026-02-02)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- feat(errors): support custom error name and extend context (#15103)
|
|
11
|
+
|
|
6
12
|
## [3.5.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/errors@3.4.0...@exodus/errors@3.5.0) (2025-11-04)
|
|
7
13
|
|
|
8
14
|
### Features
|
|
@@ -13,18 +13,24 @@ export declare const SafeContext: {
|
|
|
13
13
|
previousRouteName?: string | null | undefined;
|
|
14
14
|
}>>>;
|
|
15
15
|
traceId: import("@exodus/zod").ZodOptional<import("@exodus/zod").ZodNullable<import("@exodus/zod").ZodEffects<import("@exodus/zod").ZodString, string, string>>>;
|
|
16
|
+
reason: import("@exodus/zod").ZodOptional<import("@exodus/zod").ZodNullable<import("@exodus/zod").ZodEffects<import("@exodus/zod").ZodString, string, string>>>;
|
|
17
|
+
type: import("@exodus/zod").ZodOptional<import("@exodus/zod").ZodNullable<import("@exodus/zod").ZodEffects<import("@exodus/zod").ZodString, string, string>>>;
|
|
16
18
|
}, "strict", import("@exodus/zod").ZodTypeAny, {
|
|
19
|
+
type?: string | null | undefined;
|
|
17
20
|
navigation?: {
|
|
18
21
|
currentRouteName: string;
|
|
19
22
|
previousRouteName?: string | null | undefined;
|
|
20
23
|
} | null | undefined;
|
|
21
24
|
traceId?: string | null | undefined;
|
|
25
|
+
reason?: string | null | undefined;
|
|
22
26
|
}, {
|
|
27
|
+
type?: string | null | undefined;
|
|
23
28
|
navigation?: {
|
|
24
29
|
currentRouteName: string;
|
|
25
30
|
previousRouteName?: string | null | undefined;
|
|
26
31
|
} | null | undefined;
|
|
27
32
|
traceId?: string | null | undefined;
|
|
33
|
+
reason?: string | null | undefined;
|
|
28
34
|
}>>>>;
|
|
29
35
|
};
|
|
30
36
|
export type { SafeContextType } from './schemas.js';
|
|
@@ -11,18 +11,24 @@ declare const createContextSchema: () => z.ZodOptional<z.ZodNullable<z.ZodObject
|
|
|
11
11
|
previousRouteName?: string | null | undefined;
|
|
12
12
|
}>>>;
|
|
13
13
|
traceId: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>>;
|
|
14
|
+
reason: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>>;
|
|
15
|
+
type: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>>;
|
|
14
16
|
}, "strict", z.ZodTypeAny, {
|
|
17
|
+
type?: string | null | undefined;
|
|
15
18
|
navigation?: {
|
|
16
19
|
currentRouteName: string;
|
|
17
20
|
previousRouteName?: string | null | undefined;
|
|
18
21
|
} | null | undefined;
|
|
19
22
|
traceId?: string | null | undefined;
|
|
23
|
+
reason?: string | null | undefined;
|
|
20
24
|
}, {
|
|
25
|
+
type?: string | null | undefined;
|
|
21
26
|
navigation?: {
|
|
22
27
|
currentRouteName: string;
|
|
23
28
|
previousRouteName?: string | null | undefined;
|
|
24
29
|
} | null | undefined;
|
|
25
30
|
traceId?: string | null | undefined;
|
|
31
|
+
reason?: string | null | undefined;
|
|
26
32
|
}>>>;
|
|
27
33
|
declare const getContextSchema: () => ReturnType<typeof createContextSchema>;
|
|
28
34
|
export type SafeContextType = z.infer<ReturnType<typeof createContextSchema>>;
|
package/lib/safe-error.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getAllowlist, parseString } from '@exodus/safe-string';
|
|
1
|
+
import { getAllowlist, parseString, isSafe } from '@exodus/safe-string';
|
|
2
2
|
import assert from 'minimalistic-assert';
|
|
3
3
|
import parseStackTraceNatively, { stackFramesToString } from './stack.js';
|
|
4
4
|
import { omitUndefined } from './utils.js';
|
|
@@ -19,7 +19,7 @@ const SAFE_NAMES_SET = makeReadonlySet([
|
|
|
19
19
|
'SyntaxError',
|
|
20
20
|
]);
|
|
21
21
|
function isSafeName(value) {
|
|
22
|
-
return SAFE_NAMES_SET.has(value);
|
|
22
|
+
return SAFE_NAMES_SET.has(value) || isSafe(value);
|
|
23
23
|
}
|
|
24
24
|
function isExodusErrorCode(code) {
|
|
25
25
|
return /^(EXOD-)?\d{1,4}$/u.test(code);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/errors",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.6.0",
|
|
5
5
|
"description": "Utilities for error handling in client code, such as sanitization",
|
|
6
6
|
"author": "Exodus Movement, Inc.",
|
|
7
7
|
"repository": {
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"access": "public",
|
|
48
48
|
"provenance": false
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "26a007543e1beb809c1cbaee0b689c9209c50cf3"
|
|
51
51
|
}
|