diff --git a/src/Pecee/Pixie/ConnectionAdapters/Mysql.php b/src/Pecee/Pixie/ConnectionAdapters/Mysql.php index 9ede841..6a6b542 100644 --- a/src/Pecee/Pixie/ConnectionAdapters/Mysql.php +++ b/src/Pecee/Pixie/ConnectionAdapters/Mysql.php @@ -47,7 +47,7 @@ protected function doConnect(array $config) } } catch (\PDOException $e) { - throw new Exception($e->getMessage(), $e->getCode(), $e->getPrevious()); + throw new Exception($e->getMessage(), 0, $e->getPrevious()); } return $connection; diff --git a/src/Pecee/Pixie/ConnectionAdapters/Pgsql.php b/src/Pecee/Pixie/ConnectionAdapters/Pgsql.php index 79c3964..49d69d8 100644 --- a/src/Pecee/Pixie/ConnectionAdapters/Pgsql.php +++ b/src/Pecee/Pixie/ConnectionAdapters/Pgsql.php @@ -46,7 +46,7 @@ protected function doConnect(array $config) } } catch (\PDOException $e) { - throw new Exception($e->getMessage(), $e->getCode(), $e->getPrevious()); + throw new Exception($e->getMessage(), 0, $e->getPrevious()); } return $connection; diff --git a/src/Pecee/Pixie/ConnectionAdapters/Sqlite.php b/src/Pecee/Pixie/ConnectionAdapters/Sqlite.php index 8134ce1..116c197 100644 --- a/src/Pecee/Pixie/ConnectionAdapters/Sqlite.php +++ b/src/Pecee/Pixie/ConnectionAdapters/Sqlite.php @@ -29,7 +29,7 @@ public function doConnect(array $config) try { return new PDO($connectionString, null, null, $config['options']); } catch (\PDOException $e) { - throw new Exception($e->getMessage(), $e->getCode(), $e->getPrevious()); + throw new Exception($e->getMessage(), 0, $e->getPrevious()); } } diff --git a/src/Pecee/Pixie/QueryBuilder/QueryBuilderHandler.php b/src/Pecee/Pixie/QueryBuilder/QueryBuilderHandler.php index c3a5c4f..e8a1a6e 100644 --- a/src/Pecee/Pixie/QueryBuilder/QueryBuilderHandler.php +++ b/src/Pecee/Pixie/QueryBuilder/QueryBuilderHandler.php @@ -1087,7 +1087,7 @@ public function statement($sql, array $bindings = []) try { $pdoStatement->execute(); } catch (\PDOException $e) { - throw new Exception($e->getMessage(), $e->getCode(), $this->connection->getLastQuery()); + throw new Exception($e->getMessage(), 0, $this->connection->getLastQuery()); } return [$pdoStatement, microtime(true) - $start]; @@ -1200,7 +1200,7 @@ public function transaction(\Closure $callback) $this->pdo->rollBack(); } - throw new Exception($e->getMessage(), $e->getCode(), $e->getPrevious(), $this->connection->getLastQuery()); + throw new Exception($e->getMessage(), 0, $e->getPrevious(), $this->connection->getLastQuery()); } return $queryTransaction; diff --git a/src/Pecee/Pixie/QueryBuilder/Transaction.php b/src/Pecee/Pixie/QueryBuilder/Transaction.php index 2633e5c..deca9b8 100644 --- a/src/Pecee/Pixie/QueryBuilder/Transaction.php +++ b/src/Pecee/Pixie/QueryBuilder/Transaction.php @@ -36,7 +36,7 @@ public function commit() try { $this->pdo->commit(); } catch (\PDOException $e) { - throw new Exception($e->getMessage(), $e->getCode(), $e->getPrevious(), $this->getConnection()->getLastQuery()); + throw new Exception($e->getMessage(), 0, $e->getPrevious(), $this->connection->getLastQuery()); } throw new TransactionHaltException('Commit triggered transaction-halt.'); @@ -52,7 +52,7 @@ public function rollBack() try { $this->pdo->rollBack(); } catch (\PDOException $e) { - throw new Exception($e->getMessage(), $e->getCode(), $e->getPrevious(), $this->getConnection()->getLastQuery()); + throw new Exception($e->getMessage(), 0, $e->getPrevious(), $this->connection->getLastQuery()); } throw new TransactionHaltException('Rollback triggered transaction-halt.'); @@ -79,7 +79,7 @@ public function statement($sql, array $bindings = []) $this->transactionStatement->execute($bindings); } catch(\PDOException $e) { - throw new Exception($e->getMessage(), $e->getCode(), $e->getPrevious(), $this->getConnection()->getLastQuery()); + throw new Exception($e->getMessage(), 0, $e->getPrevious(), $this->connection->getLastQuery()); } return [$this->transactionStatement, microtime(true) - $start];