Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.6] Change signature of DetectsLostConnections to accept Throwable #22948

Merged
merged 1 commit into from
Jan 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Illuminate/Database/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 src/Illuminate/Database/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 src/Illuminate/Database/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
2 changes: 1 addition & 1 deletion src/Illuminate/Queue/Worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ protected function runJob($job, $connectionName, WorkerOptions $options)
/**
* Stop the worker if we have lost connection to a database.
*
* @param \Exception $e
* @param \Throwable $e
* @return void
*/
protected function stopWorkerIfLostConnection($e)
Expand Down