-
Notifications
You must be signed in to change notification settings - Fork 743
Closed
Labels
execIssues specific to the shell.exec() APIIssues specific to the shell.exec() APIfixBug/defect, or a fix for such a problemBug/defect, or a fix for such a problemstability
Description
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 stderrnot-an-aardvark, pibi and chadoh
Metadata
Metadata
Assignees
Labels
execIssues specific to the shell.exec() APIIssues specific to the shell.exec() APIfixBug/defect, or a fix for such a problemBug/defect, or a fix for such a problemstability