Skip to content

Commit

Permalink
Add try/catch to chain command registration. (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmolivas committed Dec 12, 2016
1 parent a1a6c8f commit 5761bb1
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/ConsoleApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,15 @@ public function registerChainCommands() {
$chainCommands = $chainDiscovery->getChainCommands();

foreach ($chainCommands as $name => $chainCommand) {
$file = $chainCommand['file'];
$description = $chainCommand['description'];
$command = new ChainCustomCommand($name, $description, $file);
$this->add($command);
try {
$file = $chainCommand['file'];
$description = $chainCommand['description'];
$command = new ChainCustomCommand($name, $description, $file);
$this->add($command);
}
catch (\Exception $e) {
echo $e->getMessage();
}
}
}

Expand Down

0 comments on commit 5761bb1

Please sign in to comment.