From 445b2e3daddf24df81909cf264e859aa644ed9c5 Mon Sep 17 00:00:00 2001 From: Tobias Schultze Date: Wed, 5 Jun 2013 10:14:54 +0200 Subject: [PATCH] [Console] fix status code when Exception::getCode returns something like 0.1 --- src/Symfony/Component/Console/Application.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Console/Application.php b/src/Symfony/Component/Console/Application.php index ad6b85368f5a..d4ad03a02fef 100644 --- a/src/Symfony/Component/Console/Application.php +++ b/src/Symfony/Component/Console/Application.php @@ -113,9 +113,16 @@ public function run(InputInterface $input = null, OutputInterface $output = null } else { $this->renderException($e, $output); } - $statusCode = $e->getCode(); - $statusCode = is_numeric($statusCode) && $statusCode ? (int) $statusCode : 1; + $statusCode = $e->getCode(); + if (is_numeric($statusCode)) { + $statusCode = (int) $statusCode; + if (0 === $statusCode) { + $statusCode = 1; + } + } else { + $statusCode = 1; + } } if ($this->autoExit) {