This commit is contained in:
2025-12-16 20:20:08 +08:00
parent 0dcd548645
commit ee1a5a993d
9 changed files with 142 additions and 29 deletions
+21 -3
View File
@@ -188,15 +188,33 @@ class Command extends Component
*/
protected function isRefresh(Throwable $throwable): bool
{
if (str_contains($throwable->getMessage(), 'MySQL server has gone away')) {
$message = $throwable->getMessage();
// MySQL 错误处理
if (str_contains($message, 'MySQL server has gone away')) {
return true;
}
if (str_contains($throwable->getMessage(), 'Send of 14 bytes failed with errno=32 Broken pipe')) {
if (str_contains($message, 'Send of 14 bytes failed with errno=32 Broken pipe')) {
return true;
}
if (str_contains($throwable->getMessage(), 'Lost connection to MySQL server during query')) {
if (str_contains($message, 'Lost connection to MySQL server during query')) {
return true;
}
// PostgreSQL 错误处理
if (str_contains($message, 'server closed the connection unexpectedly')) {
return true;
}
if (str_contains($message, 'Connection refused')) {
return true;
}
if (str_contains($message, 'Broken pipe')) {
return true;
}
if (str_contains($message, 'connection to server was lost')) {
return true;
}
return false;
}