Skip to content

Commit ff29a1a

Browse files
committed
minor #52666 [Cache] name exception being caught as it is accessed in the catch block (xabbuh)
This PR was merged into the 6.3 branch. Discussion ---------- [Cache] name exception being caught as it is accessed in the catch block | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | | License | MIT Commits ------- 75781d0 name exception being caught as it is accessed in the catch block
2 parents 861d85f + 75781d0 commit ff29a1a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Cache/Adapter/PdoAdapter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ protected function doSave(array $values, int $lifetime): array|bool
285285
$lifetime = $lifetime ?: null;
286286
try {
287287
$stmt = $conn->prepare($sql);
288-
} catch (\PDOException) {
288+
} catch (\PDOException $e) {
289289
if ($this->isTableMissing($e) && (!$conn->inTransaction() || \in_array($this->driver, ['pgsql', 'sqlite', 'sqlsrv'], true))) {
290290
$this->createTable();
291291
}
@@ -320,7 +320,7 @@ protected function doSave(array $values, int $lifetime): array|bool
320320
foreach ($values as $id => $data) {
321321
try {
322322
$stmt->execute();
323-
} catch (\PDOException) {
323+
} catch (\PDOException $e) {
324324
if ($this->isTableMissing($e) && (!$conn->inTransaction() || \in_array($this->driver, ['pgsql', 'sqlite', 'sqlsrv'], true))) {
325325
$this->createTable();
326326
}

0 commit comments

Comments
 (0)
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