-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
dotnet/runtime
#39768Description
While renaming a file and if one of the parent paths do not exist the error code is being overwritten to EBUSY instead of reporting the actual error:
Error no 44 Error: ENOENT Message: No such file or directory
Line 729 in 126fa66
| throw new FS.ErrnoError({{{ cDefine('EBUSY') }}}); |
Suggested code that returns back the original error code is the following:
// parents must exist
var lookup, old_dir, new_dir;
try {
lookup = FS.lookupPath(old_path, { parent: true });
old_dir = lookup.node;
lookup = FS.lookupPath(new_path, { parent: true });
new_dir = lookup.node;
} catch (e) {
// do not override failing error
if (e instanceof FS.ErrnoError)
throw e;
throw new FS.ErrnoError(10);
}
Metadata
Metadata
Assignees
Labels
No labels