my ($driver, $error) = @_;
if ($driver eq 'mysql') {
return 1 if $error =~ /Could not connect to database.+?failed: Too many connections/s; # problem on server side (configured with not enough connections)
return 1 if $error =~ /Could not connect to database.+?failed: Can't connect to \w+? server on '.+?' \(99\)/s; # problem on client side (cooling down period after a disconnect)
return 1 if $error =~ /Could not connect to database.+?failed: Can't connect to \w+? server on '.+?' \(110\)/s; # problem on server side ("Connection timed out"L the server is temporarily dropping connections until it reaches a reasonable load)
return 1 if $error =~ /Could not connect to database.+?failed: Lost connection to MySQL server at 'reading authorization packet', system error: 0/s; # problem on server side (server too busy ?)
}
return 0;
}