From 7a9495cf44d02f281b06dcfba8b611b27397d737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Monta=C3=B1ez?= Date: Sat, 11 Oct 2014 12:10:07 -0200 Subject: [PATCH] Issue #130 --- Mage/Console.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Mage/Console.php b/Mage/Console.php index 83ce6cb..6f55e8b 100644 --- a/Mage/Console.php +++ b/Mage/Console.php @@ -135,12 +135,16 @@ class Console throw new Exception('You must specify an environment for this command.'); } } + + // Run the Command $exitCode = $command->run(); + + // Check for errors if (is_int($exitCode) && $exitCode !== 0) { - throw new Exception("Command execution failed with following exit code: $exitCode.", $exitCode); + throw new Exception('Command execution failed with following exit code: ' . $exitCode, $exitCode); } elseif (is_bool($exitCode) && !$exitCode) { $exitCode = 1; - throw new Exception("Command execution failed.", $exitCode); + throw new Exception('Command execution failed.', $exitCode); } } catch (Exception $exception) { self::output('' . $exception->getMessage() . '', 1, 2);