Skip to content

Commit d4058b8

Browse files
committed
Possible fix for #191
`TypeError: Exception::__construct(): Argument #2 ($code) must be of type int, string given in vendor/foolz/sphinxql-query-builder/src/Drivers/Pdo/Connection.php:28`
1 parent 8074da6 commit d4058b8

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)