sonarrradarrplexorganizrnginxdashboardlandingpagestartpagelandinghtpcserverhomepagesabnzbdheimdallembycouchpotatonzbgetbookmarkapplication-dashboardmuximux
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.0 KiB
37 lines
1.0 KiB
<?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',
|
|
'Error writing data to the connection',
|
|
'Resource deadlock avoided',
|
|
'Transaction() on null',
|
|
'child connection forced to terminate due to client_idle_limit',
|
|
'query_wait_timeout',
|
|
'reset by peer',
|
|
]);
|
|
}
|
|
}
|
|
|