Skip to content

Commit

Permalink
Change signature of DetectsLostConnections to accept Throwable (#22948)
Browse files Browse the repository at this point in the history
  • Loading branch information
ollielowson authored and taylorotwell committed Jan 29, 2018
1 parent 0d6f182 commit 68cb247
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Concerns/ManagesTransactions.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ protected function createSavepoint()
/**
* Handle an exception from a transaction beginning.
*
* @param \Exception $e
* @param \Throwable $e
* @return void
*
* @throws \Exception
Expand Down
5 changes: 3 additions & 2 deletions Connectors/Connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use PDO;
use Exception;
use Throwable;
use Doctrine\DBAL\Driver\PDOConnection;
use Illuminate\Database\DetectsLostConnections;

Expand Down Expand Up @@ -82,7 +83,7 @@ protected function isPersistentConnection($options)
/**
* Handle an exception that occurred during connect execution.
*
* @param \Exception $e
* @param \Throwable $e
* @param string $dsn
* @param string $username
* @param string $password
Expand All @@ -91,7 +92,7 @@ protected function isPersistentConnection($options)
*
* @throws \Exception
*/
protected function tryAgainIfCausedByLostConnection(Exception $e, $dsn, $username, $password, $options)
protected function tryAgainIfCausedByLostConnection(Throwable $e, $dsn, $username, $password, $options)
{
if ($this->causedByLostConnection($e)) {
return $this->createPdoConnection($dsn, $username, $password, $options);
Expand Down
6 changes: 3 additions & 3 deletions DetectsLostConnections.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

namespace Illuminate\Database;

use Exception;
use Throwable;
use Illuminate\Support\Str;

trait DetectsLostConnections
{
/**
* Determine if the given exception was caused by a lost connection.
*
* @param \Exception $e
* @param \Throwable $e
* @return bool
*/
protected function causedByLostConnection(Exception $e)
protected function causedByLostConnection(Throwable $e)
{
$message = $e->getMessage();

Expand Down

0 comments on commit 68cb247

Please sign in to comment.