Skip to content

Commit

Permalink
Fix misleading exception when ExceptionHandler is not bound (#16666)
Browse files Browse the repository at this point in the history
  • Loading branch information
foglcz authored and taylorotwell committed Dec 6, 2016
1 parent 0927be8 commit 65115c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Connectors/ConnectionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ protected function createPdoResolverWithHosts(array $config)
try {
return $this->createConnector($config)->connect($config);
} catch (PDOException $e) {
if (count($hosts) - 1 === $key) {
if (count($hosts) - 1 === $key && $this->container->bound(ExceptionHandler::class)) {
$this->container->make(ExceptionHandler::class)->report($e);
}
}
Expand Down

0 comments on commit 65115c4

Please sign in to comment.