Skip to content

Commit

Permalink
Merge pull request #1084 from staabm/patch-1
Browse files Browse the repository at this point in the history
Pretty-print uncaught exceptions with SymfonyStyle
  • Loading branch information
antonmedv authored Mar 10, 2017
2 parents 21ee927 + c1a8c10 commit dfeb152
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions bin/dep
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@ $input = new \Symfony\Component\Console\Input\ArgvInput();
$output = new \Symfony\Component\Console\Output\ConsoleOutput();
$deployer = new \Deployer\Deployer($console, $input, $output);

// Pretty-print uncaught exceptions in symfony-console
// SymfonyStyle was added in sf-console 2.7, therefore we feature detect first
if (class_exists('\Symfony\Component\Console\Style\SymfonyStyle')) {
set_exception_handler(function($e) use ($input, $output) {
$io = new \Symfony\Component\Console\Style\SymfonyStyle($input, $output);
$io->error($e);
});
}

// Require deploy.php file
if (is_readable($deployFile)) {
// Prevent variable leak into deploy.php file
Expand Down

0 comments on commit dfeb152

Please sign in to comment.