From 3bdd7701297fa0958dddf11e69668dfafe2fa990 Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Thu, 13 Apr 2023 12:53:40 +0200 Subject: fix: Check for wrapped retriable exceptions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/private/DB/Exceptions/DbalException.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/private/DB') diff --git a/lib/private/DB/Exceptions/DbalException.php b/lib/private/DB/Exceptions/DbalException.php index f9610c5bf25..2b860a50ff3 100644 --- a/lib/private/DB/Exceptions/DbalException.php +++ b/lib/private/DB/Exceptions/DbalException.php @@ -37,6 +37,7 @@ use Doctrine\DBAL\Exception\InvalidArgumentException; use Doctrine\DBAL\Exception\InvalidFieldNameException; use Doctrine\DBAL\Exception\NonUniqueFieldNameException; use Doctrine\DBAL\Exception\NotNullConstraintViolationException; +use Doctrine\DBAL\Exception\RetryableException; use Doctrine\DBAL\Exception\ServerException; use Doctrine\DBAL\Exception\SyntaxErrorException; use Doctrine\DBAL\Exception\UniqueConstraintViolationException; @@ -74,6 +75,10 @@ class DbalException extends Exception { ); } + public function isRetryable(): bool { + return $this->original instanceof RetryableException; + } + public function getReason(): ?int { /** * Constraint errors -- cgit v1.2.3