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

shell.exec() doesn't respond correctly to config.fatal = true #735

Closed
nfischer opened this issue Jun 14, 2017 · 1 comment
Closed

shell.exec() doesn't respond correctly to config.fatal = true #735

nfischer opened this issue Jun 14, 2017 · 1 comment
Assignees
Labels
exec Issues specific to the shell.exec() API fix Bug/defect, or a fix for such a problem stability

Comments

@nfischer
Copy link
Member

Node version (or tell us if you're using electron or some other framework):

all

ShellJS version (the most recent version/Github branch you see the bug on):

master

Operating system:

all

Description of the bug:

Setting config.fatal = true messes up shell.exec(). When config.fatal is true, we throw an exception from common.error(). Unfortunately, this gets caught by ShellJS and is treated like an internal error, which isn't correct.

Example ShellJS command to reproduce the error:

> shell.config.fatal = true;
> shell.exec('cmd_that_fails');
Error: exec: internal error
    at Object.error (/path/to/shelljs/src/common.js:130:27)
    at Object._exec (/path/to/shelljs/src/exec.js:292:12)
    at Object.exec (/path/to/shelljs/src/common.js:334:23)
    at repl:1:3
    at sigintHandlersWrap (vm.js:22:35)
    at sigintHandlersWrap (vm.js:96:12)
    at ContextifyScript.Script.runInThisContext (vm.js:21:12)
    at REPLServer.defaultEval (repl.js:313:29)
    at bound (domain.js:280:14)
    at REPLServer.runBound [as eval] (domain.js:293:12)
> // the exception is expected to contain the command's stderr
@nfischer nfischer added exec Issues specific to the shell.exec() API fix Bug/defect, or a fix for such a problem stability labels Jun 14, 2017
@nfischer nfischer self-assigned this Jun 14, 2017
@nfischer
Copy link
Member Author

nfischer commented Feb 7, 2018

This was fixed by #802. Expect this in 0.8.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exec Issues specific to the shell.exec() API fix Bug/defect, or a fix for such a problem stability
Projects
None yet
Development

No branches or pull requests

1 participant