Skip to content

Commit 7ad9d57

Browse files
committed
Include filename when reporting not found
1 parent cf87bd4 commit 7ad9d57

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/harness/vfs.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ namespace vfs {
444444

445445
private _stat(entry: WalkResult) {
446446
const node = entry.node;
447-
if (!node) throw createIOError("ENOENT");
447+
if (!node) throw createIOError(`ENOENT`, entry.realpath);
448448
return new Stats(
449449
node.dev,
450450
node.ino,
@@ -1155,8 +1155,8 @@ namespace vfs {
11551155
EROFS: "file system is read-only"
11561156
});
11571157

1158-
export function createIOError(code: keyof typeof IOErrorMessages) {
1159-
const err: NodeJS.ErrnoException = new Error(`${code}: ${IOErrorMessages[code]}`);
1158+
export function createIOError(code: keyof typeof IOErrorMessages, details: string = "") {
1159+
const err: NodeJS.ErrnoException = new Error(`${code}: ${IOErrorMessages[code]} ${details}`);
11601160
err.code = code;
11611161
if (Error.captureStackTrace) Error.captureStackTrace(err, createIOError);
11621162
return err;

0 commit comments

Comments
 (0)