diff --git a/src/Adapter/Adapter.php b/src/Adapter/Adapter.php index a9f9a942..2c5ed0d3 100644 --- a/src/Adapter/Adapter.php +++ b/src/Adapter/Adapter.php @@ -316,7 +316,7 @@ protected function createDriver($parameters) } if (! isset($driver) || ! $driver instanceof Driver\DriverInterface) { - throw new Exception\InvalidArgumentException('DriverInterface expected', null, null); + throw new Exception\InvalidArgumentException('DriverInterface expected'); } return $driver; diff --git a/src/Adapter/Driver/Mysqli/Statement.php b/src/Adapter/Driver/Mysqli/Statement.php index fe7d4d25..a2c17570 100644 --- a/src/Adapter/Driver/Mysqli/Statement.php +++ b/src/Adapter/Driver/Mysqli/Statement.php @@ -188,7 +188,7 @@ public function prepare($sql = null) if (! $this->resource instanceof mysqli_stmt) { throw new Exception\InvalidQueryException( 'Statement couldn\'t be produced with sql: ' . $sql, - null, + $this->mysqli->errno, new Exception\ErrorException($this->mysqli->error, $this->mysqli->errno) ); } diff --git a/src/Adapter/Driver/Oci8/Connection.php b/src/Adapter/Driver/Oci8/Connection.php index 7ab82f0a..6b1f7459 100644 --- a/src/Adapter/Driver/Oci8/Connection.php +++ b/src/Adapter/Driver/Oci8/Connection.php @@ -129,7 +129,7 @@ public function connect() $e = oci_error(); throw new Exception\RuntimeException( 'Connection error', - null, + $e['code'], new Exception\ErrorException($e['message'], $e['code']) ); } diff --git a/src/Adapter/Driver/Oci8/Statement.php b/src/Adapter/Driver/Oci8/Statement.php index c356843e..5f27d2c0 100644 --- a/src/Adapter/Driver/Oci8/Statement.php +++ b/src/Adapter/Driver/Oci8/Statement.php @@ -184,7 +184,7 @@ public function prepare($sql = null) $e = oci_error($this->oci8); throw new Exception\InvalidQueryException( 'Statement couldn\'t be produced with sql: ' . $sql, - null, + $e['code'], new Exception\ErrorException($e['message'], $e['code']) ); } diff --git a/src/Adapter/Driver/Sqlsrv/Connection.php b/src/Adapter/Driver/Sqlsrv/Connection.php index b4f569c1..46089851 100644 --- a/src/Adapter/Driver/Sqlsrv/Connection.php +++ b/src/Adapter/Driver/Sqlsrv/Connection.php @@ -135,7 +135,7 @@ public function connect() if (! $this->resource) { throw new Exception\RuntimeException( 'Connect Error', - null, + 0, new ErrorException(sqlsrv_errors()) ); }