Skip to content

Commit ff29a1a

Browse files
committedNov 21, 2023
minor symfony#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

+2-2
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)
Please sign in to comment.