bun
bun copied to clipboard
[fs] `path` is missed in `Error` object
What version of Bun is running?
1.0.23
What platform is your computer?
Window 10
What steps can reproduce the bug?
import fs from "node:fs/promises";
try {
await fs.stat("c:/qwerty123");
} catch (e) {
console.error(e);
console.error(e.message);
console.error(e.errno);
console.error(e.code);
console.error(e.syscall);
console.error(e.path);
}
What is the expected behavior?
Node.js:
[Error: ENOENT: no such file or directory, stat 'c:\qwerty123'] {
errno: -4058,
code: 'ENOENT',
syscall: 'stat',
path: 'c:\\qwerty123'
}
ENOENT: no such file or directory, stat 'c:\qwerty123'
-4058
ENOENT
stat
c:\qwerty123
What do you see instead?
Bun:
ENOENT: No such file or directory
errno: -4058
syscall: "stat"
No such file or directory
-4058
ENOENT
stat
undefined
Additional information
path
property is really useful in IO errors. However, it's undefined
in Bun, while it is present in Node.js.
Updating tags and issue description as this is more than just Windows. It's just a feature gap.