Commit 0cfd41a2 by Carsten Brandt

let application exit with code 1 on error/exception in console

fixes #2233
parent 9ba8b185
......@@ -515,6 +515,9 @@ abstract class Application extends Module
$handler->handle($exception);
} else {
echo $this->renderException($exception);
if (PHP_SAPI === 'cli') {
exit(1);
}
}
} catch (\Exception $e) {
// exception could be thrown in ErrorHandler::handle()
......
......@@ -87,7 +87,7 @@ class ErrorHandler extends Component
{
if (Yii::$app instanceof \yii\console\Application || YII_ENV_TEST) {
echo Yii::$app->renderException($exception);
return;
exit(1);
}
$useErrorView = !YII_DEBUG || $exception instanceof UserException;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment