Skip to content

Commit b828c65

Browse files
authored
Merge pull request #201 from scholieren-com/bugfix/wrong-parameters-for-exception
Fix PDOException $code data type
2 parents e305435 + d4058b8 commit b828c65

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Drivers/Pdo/Connection.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ public function query($query)
2525
try {
2626
$statement->execute();
2727
} catch (PDOException $exception) {
28-
throw new DatabaseException($exception->getMessage() . ' [' . $query . ']', $exception->getCode(), $exception);
28+
throw new DatabaseException('[' . $exception->getCode() . '] ' . $exception->getMessage() . ' [' . $query . ']',
29+
(int)$exception->getCode(), $exception);
2930
}
3031

3132
return new ResultSet(new ResultSetAdapter($statement));

0 commit comments

Comments
 (0)