From 75781d0b380bc5ba1307a8b95bd73341bf3e1606 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 21 Nov 2023 00:54:54 +0100 Subject: [PATCH] name exception being caught as it is accessed in the catch block --- src/Symfony/Component/Cache/Adapter/PdoAdapter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Cache/Adapter/PdoAdapter.php b/src/Symfony/Component/Cache/Adapter/PdoAdapter.php index 976bb056b2285..cf0059e840f92 100644 --- a/src/Symfony/Component/Cache/Adapter/PdoAdapter.php +++ b/src/Symfony/Component/Cache/Adapter/PdoAdapter.php @@ -285,7 +285,7 @@ protected function doSave(array $values, int $lifetime): array|bool $lifetime = $lifetime ?: null; try { $stmt = $conn->prepare($sql); - } catch (\PDOException) { + } catch (\PDOException $e) { if ($this->isTableMissing($e) && (!$conn->inTransaction() || \in_array($this->driver, ['pgsql', 'sqlite', 'sqlsrv'], true))) { $this->createTable(); } @@ -320,7 +320,7 @@ protected function doSave(array $values, int $lifetime): array|bool foreach ($values as $id => $data) { try { $stmt->execute(); - } catch (\PDOException) { + } catch (\PDOException $e) { if ($this->isTableMissing($e) && (!$conn->inTransaction() || \in_array($this->driver, ['pgsql', 'sqlite', 'sqlsrv'], true))) { $this->createTable(); } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy