Skip to content

Commit

Permalink
Do not set code when recasting PDOException (#2101)
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterOdin authored Jul 15, 2022
1 parent 1772144 commit 9ba5deb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Phinx/Db/Adapter/PdoAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ protected function createPdoConnection(string $dsn, ?string $username = null, ?s
throw new InvalidArgumentException(sprintf(
'There was a problem connecting to the database: %s',
$e->getMessage()
), $e->getCode(), $e);
), 0, $e);
}

return $db;
Expand Down
2 changes: 1 addition & 1 deletion src/Phinx/Db/Adapter/PostgresAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function connect(): void
} catch (PDOException $exception) {
throw new InvalidArgumentException(
sprintf('Schema does not exists: %s', $options['schema']),
$exception->getCode(),
0,
$exception
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Phinx/Db/Adapter/SqlServerAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ protected function connectDblib(): void
throw new InvalidArgumentException(sprintf(
'There was a problem connecting to the database: %s',
$exception->getMessage()
));
), 0, $exception);
}

$this->setConnection($db);
Expand Down

0 comments on commit 9ba5deb

Please # to comment.