diff options
Diffstat (limited to 'src/Script/Console.php')
-rw-r--r-- | src/Script/Console.php | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/Script/Console.php b/src/Script/Console.php index e1d7df5..3228750 100644 --- a/src/Script/Console.php +++ b/src/Script/Console.php @@ -5,6 +5,7 @@ namespace App\Script; use App\Model\Vendor; use App\Script\Input; use App\Script\Output; +use Exception; /** * Main application class @@ -44,12 +45,16 @@ class Console */ public function exec() { - $input = new Input; - $vendors = Vendor::loadAll($input->getOption('f')); + $output = new Output; + try { + $input = new Input; + $vendors = Vendor::loadAll($input->getOption('f')); - $vendors->filterByInput($input); + $vendors->filterByInput($input); - $output = new Output; - $output->printCollection($vendors); + $output->printCollection($vendors); + } catch (Exception $e) { + $output->printException($e); + } } } |