Skip to content

Commit

Permalink
name exception being caught as it is accessed in the catch block
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Nov 20, 2023
1 parent bb03b99 commit f2e5f1d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Symfony/Component/Lock/Store/PdoStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function save(Key $key)
$conn = $this->getConnection();
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();
}
Expand All @@ -106,7 +106,7 @@ public function save(Key $key)

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

Expand Down

0 comments on commit f2e5f1d

Please sign in to comment.