kerium 1.3.1 → 1.3.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/dist/error.d.ts CHANGED
@@ -457,5 +457,6 @@ export declare function UV(this: void, code: keyof typeof Errno, context?: Excep
457
457
  * Shortcut to easily create an `ErrnoException` with a specific error code.
458
458
  */
459
459
  export declare function withErrno(this: void, code: keyof typeof Errno, message?: string): Exception;
460
+ export declare function rethrow(syscall: string, path?: string, dest?: string): (e: Exception) => never;
460
461
  export declare function rethrow(extra: ExceptionExtra): (e: Exception) => never;
461
462
  export {};
package/dist/error.js CHANGED
@@ -491,9 +491,10 @@ export function withErrno(code, message) {
491
491
  Error.captureStackTrace?.(err, withErrno);
492
492
  return err;
493
493
  }
494
- export function rethrow(extra) {
494
+ export function rethrow(extra, path, dest) {
495
+ const ctx = typeof extra === 'string' ? { syscall: extra, path, dest } : extra;
495
496
  return function (e) {
496
- Object.assign(e, extra);
497
+ Object.assign(e, ctx);
497
498
  setUVMessage(e);
498
499
  throw e;
499
500
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kerium",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "POSIX-style errors, logging, and more",
5
5
  "author": "James Prevett <jp@jamespre.dev> (https://jamespre.dev)",
6
6
  "repository": {