@exodus/errors 2.0.1 → 2.0.2

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
+ ## [2.0.2](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/errors@2.0.1...@exodus/errors@2.0.2) (2025-02-27)
7
+
8
+ ### Bug Fixes
9
+
10
+ - fix(errors): not export FACTORY_SYMBOL and other fixes (#11618)
11
+
6
12
  ## [2.0.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/errors@2.0.0...@exodus/errors@2.0.1) (2025-02-26)
7
13
 
8
14
  ### Bug Fixes
@@ -11,7 +11,7 @@ type UnknownError = Error & {
11
11
  hint?: unknown;
12
12
  code?: unknown;
13
13
  };
14
- export declare const FACTORY_SYMBOL: unique symbol;
14
+ declare const FACTORY_SYMBOL: unique symbol;
15
15
  export declare class SafeError {
16
16
  #private;
17
17
  static readonly hints: {
@@ -50,7 +50,11 @@ export declare class SafeError {
50
50
  get stack(): string | undefined;
51
51
  get timestamp(): number;
52
52
  toJSON(): {
53
- [k: string]: any;
53
+ name: SafeName;
54
+ code?: SafeCode;
55
+ hint?: SafeHint;
56
+ stack?: string;
57
+ timestamp: number;
54
58
  };
55
59
  constructor({ name, code, hint, stack, initSymbol, }: {
56
60
  name: SafeName;
package/lib/safe-error.js CHANGED
@@ -59,7 +59,7 @@ function isExodusErrorCode(code) {
59
59
  function isSafeCode(value) {
60
60
  return SAFE_CODES_SET.has(value) || isExodusErrorCode(value);
61
61
  }
62
- export const FACTORY_SYMBOL = Symbol('SafeError');
62
+ const FACTORY_SYMBOL = Symbol('SafeError');
63
63
  export class SafeError {
64
64
  static hints = safeHints;
65
65
  static from(err) {
package/lib/stack.js CHANGED
@@ -4,8 +4,8 @@ export function stackFramesToString(frames) {
4
4
  }
5
5
  return frames
6
6
  .map((frame) => {
7
- const { function: fn, method, file, line, column } = frame;
8
- return ` at ${fn || 'unknownFn'}${method ? `.${method}` : ''}${file ? `(${file}${line === null ? '' : `:${line}:${column}`})` : ''}`;
7
+ const { function: fn, file, line, column } = frame;
8
+ return ` at ${fn || 'unknownFn'}${file ? ` (${file}${line === null ? '' : `:${line}:${column}`})` : ''}`;
9
9
  })
10
10
  .join('\n');
11
11
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@exodus/errors",
3
3
  "type": "module",
4
- "version": "2.0.1",
4
+ "version": "2.0.2",
5
5
  "description": "Utilities for error handling in client code, such as sanitization",
6
6
  "author": "Exodus Movement, Inc.",
7
7
  "repository": {
@@ -44,5 +44,5 @@
44
44
  "publishConfig": {
45
45
  "access": "public"
46
46
  },
47
- "gitHead": "9e1b52c35ef29db1bcd593e771c318ad6db6d62c"
47
+ "gitHead": "7fa27377d258917916c478eaa84e2495a23467be"
48
48
  }