kerium 1.3.2 → 1.3.3
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.js +6 -2
- package/package.json +1 -1
package/dist/error.js
CHANGED
|
@@ -415,7 +415,7 @@ export function setUVMessage(ex) {
|
|
|
415
415
|
message += ` '${ex.path}'`;
|
|
416
416
|
if (ex.dest)
|
|
417
417
|
message += ` -> '${ex.dest}'`;
|
|
418
|
-
if (ex.message)
|
|
418
|
+
if (ex.message && ex.message !== errnoMessages[ex.errno])
|
|
419
419
|
message += ` (${ex.message})`;
|
|
420
420
|
ex.message = message;
|
|
421
421
|
return ex;
|
|
@@ -492,7 +492,11 @@ export function withErrno(code, message) {
|
|
|
492
492
|
return err;
|
|
493
493
|
}
|
|
494
494
|
export function rethrow(extra, path, dest) {
|
|
495
|
-
const ctx = typeof extra === 'string' ? { syscall: extra
|
|
495
|
+
const ctx = typeof extra === 'string' ? { syscall: extra } : extra;
|
|
496
|
+
if (path)
|
|
497
|
+
ctx.path = path;
|
|
498
|
+
if (dest)
|
|
499
|
+
ctx.dest = dest;
|
|
496
500
|
return function (e) {
|
|
497
501
|
Object.assign(e, ctx);
|
|
498
502
|
setUVMessage(e);
|