Skip to content

Commit 02102f9

Browse files
committed
minor symfony#52664 [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 ------- f2e5f1d name exception being caught as it is accessed in the catch block
2 parents bb03b99 + f2e5f1d commit 02102f9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Lock/Store/PdoStore.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function save(Key $key)
9494
$conn = $this->getConnection();
9595
try {
9696
$stmt = $conn->prepare($sql);
97-
} catch (\PDOException) {
97+
} catch (\PDOException $e) {
9898
if ($this->isTableMissing($e) && (!$conn->inTransaction() || \in_array($this->driver, ['pgsql', 'sqlite', 'sqlsrv'], true))) {
9999
$this->createTable();
100100
}
@@ -106,7 +106,7 @@ public function save(Key $key)
106106

107107
try {
108108
$stmt->execute();
109-
} catch (\PDOException) {
109+
} catch (\PDOException $e) {
110110
if ($this->isTableMissing($e) && (!$conn->inTransaction() || \in_array($this->driver, ['pgsql', 'sqlite', 'sqlsrv'], true))) {
111111
$this->createTable();
112112

0 commit comments

Comments
 (0)