Skip to content
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

Don't kill the node process upon unexpected error #483

Closed
nfischer opened this issue Jul 25, 2016 · 3 comments
Closed

Don't kill the node process upon unexpected error #483

nfischer opened this issue Jul 25, 2016 · 3 comments
Labels
breaking Breaking change fix Bug/defect, or a fix for such a problem
Milestone

Comments

@nfischer
Copy link
Member

#64 and #473 are examples of complaints about this.

Currently, ShellJS will kill the process if it encounters an unexpected ("internal") error. Ideally, the commands should all catch these before they arise, but since nothing is ever perfect so sometimes utilities fail for various reasons (permissions errors are a big reason).

It'd be great if ShellJS threw an exception instead of killing the process, since this would at least allow users the chance to catch the exception in their code. If the exception is left uncaught at the top-level, this would kill the process anyway as it currently does. This could have significantly different behavior if thrown inside of a try-catch, however, so this would be a breaking change.

@nfischer nfischer added the fix Bug/defect, or a fix for such a problem label Jul 25, 2016
@nfischer nfischer added this to the v0.8.0 milestone Jul 25, 2016
@ariporad
Copy link
Contributor

I agree... I'm not sure why we ever started killing the process.

One thing though is that it might make sense to change the error's .stack property, to make it somewhat more useful... I'm not sure exactly what form this would take, but getting a stack trace to some shelljs error handler isn't likely to be that useful.

@nfischer
Copy link
Member Author

@ariporad Do you want to take this on? I imagine we'll just want to keep whatever the stack is from before, and maybe also add in a message like "ShellJS internal error" on the top of the stack trace.

@nfischer
Copy link
Member Author

Fixed on dev branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Breaking change fix Bug/defect, or a fix for such a problem
Projects
None yet
Development

No branches or pull requests

2 participants