Skip to content
Permalink
Browse files

Handling custom exit codes

  • Loading branch information...
jeremyharris committed Jun 5, 2018
1 parent 00c156b commit cc17cdeca89871bea06fa941783e051e4b37f91e
@@ -95,7 +95,7 @@ public function exec($command, array $input = [])
try {
$this->_exitCode = $runner->run($args, $io);
} catch (StopException $exception) {
$this->_exitCode = Command::CODE_ERROR;
$this->_exitCode = $exception->getCode();
}
}
@@ -80,7 +80,7 @@ public function testExecCommandWithStopException()
{
$this->useCommandRunner();
$this->exec('abort_command');
$this->assertExitCode(Shell::CODE_ERROR);
$this->assertExitCode(127);
$this->assertErrorContains('Command aborted');
}
@@ -10,6 +10,6 @@ class AbortCommand extends Command
public function execute(Arguments $args, ConsoleIo $io)
{
$io->error('Command aborted');
$this->abort();
$this->abort(127);
}
}

0 comments on commit cc17cde

Please sign in to comment.
You can’t perform that action at this time.