update v 1.0.7.5
This commit is contained in:
34
vendor/laravel/framework/src/Illuminate/Database/DetectsLostConnections.php
vendored
Normal file
34
vendor/laravel/framework/src/Illuminate/Database/DetectsLostConnections.php
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Database;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
trait DetectsLostConnections
|
||||
{
|
||||
/**
|
||||
* Determine if the given exception was caused by a lost connection.
|
||||
*
|
||||
* @param \Exception $e
|
||||
* @return bool
|
||||
*/
|
||||
protected function causedByLostConnection(Exception $e)
|
||||
{
|
||||
$message = $e->getMessage();
|
||||
|
||||
return Str::contains($message, [
|
||||
'server has gone away',
|
||||
'no connection to the server',
|
||||
'Lost connection',
|
||||
'is dead or not enabled',
|
||||
'Error while sending',
|
||||
'decryption failed or bad record mac',
|
||||
'server closed the connection unexpectedly',
|
||||
'SSL connection has been closed unexpectedly',
|
||||
'Deadlock found when trying to get lock',
|
||||
'Error writing data to the connection',
|
||||
'Resource deadlock avoided',
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user