New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling permissions errors on file I/O #64
Comments
It would also be nice if at least shelljs still respected the fatal argument. Since this is an OS error it always calls process.exit (https://github.com/arturadib/shelljs/blob/master/src/common.js#L179) |
Bumping this issue. I'm trying to use shelljs in a server environment because frankly, it's way easier to use than the built-in nodejs logic and my use is minimal so I'm not too worried about synchronicity performance issues. I've been using exec() to mv files when needed instead of mv() because I can't have shelljs killing my server process just because it encountered an EACCES error. I would actually vote that shelljs never terminate the process and just throw exceptions instead; let the developers handle the errors! Barring that, my second vote would be to at least make shelljs respect the config.fatal setting in all circumstances, as suggested by @jeffheifetz, so the behavior could be overridden when appropriate. |
In comparison
|
#474 fixed this issue for |
This exception just means "there's a bug in shelljs, it didn't handle something it should have handled." So, this issue is about a very general problem. I already fixed the mkdir issue in #474, and I filed an issue specific to mv in #872. I'm closing this in favor of the mv-specific issue. Anyone stumbling across this thread: if you have a similar exception, please file a new github issue, as it will likely require a unique patch. |
It would be nice if shelljs gracefully handled file I/O errors due to permissions issues, as opposed to the current full error dump you get now:
It seems like, for a lot of use cases (like this one), a more user-friendly error handling path could be initiated.
The text was updated successfully, but these errors were encountered: