Include filename when reporting not found
This commit is contained in:
parent
cf87bd446d
commit
7ad9d57cc7
|
@ -444,7 +444,7 @@ namespace vfs {
|
||||||
|
|
||||||
private _stat(entry: WalkResult) {
|
private _stat(entry: WalkResult) {
|
||||||
const node = entry.node;
|
const node = entry.node;
|
||||||
if (!node) throw createIOError("ENOENT");
|
if (!node) throw createIOError(`ENOENT`, entry.realpath);
|
||||||
return new Stats(
|
return new Stats(
|
||||||
node.dev,
|
node.dev,
|
||||||
node.ino,
|
node.ino,
|
||||||
|
@ -1155,8 +1155,8 @@ namespace vfs {
|
||||||
EROFS: "file system is read-only"
|
EROFS: "file system is read-only"
|
||||||
});
|
});
|
||||||
|
|
||||||
export function createIOError(code: keyof typeof IOErrorMessages) {
|
export function createIOError(code: keyof typeof IOErrorMessages, details: string = "") {
|
||||||
const err: NodeJS.ErrnoException = new Error(`${code}: ${IOErrorMessages[code]}`);
|
const err: NodeJS.ErrnoException = new Error(`${code}: ${IOErrorMessages[code]} ${details}`);
|
||||||
err.code = code;
|
err.code = code;
|
||||||
if (Error.captureStackTrace) Error.captureStackTrace(err, createIOError);
|
if (Error.captureStackTrace) Error.captureStackTrace(err, createIOError);
|
||||||
return err;
|
return err;
|
||||||
|
|
Loading…
Reference in a new issue