Skip to content

Commit 75781d0

Browse files
committed
name exception being caught as it is accessed in the catch block
1 parent 861d85f commit 75781d0

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)