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
|
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);
}
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:
emscripten/src/library_fs.js
Line 729 in 126fa66
Suggested code that returns back the original error code is the following: