Skip to content

Commit

Permalink
Merge branch '4.1'
Browse files Browse the repository at this point in the history
taylorotwell committed Dec 22, 2013
2 parents 3bd0e36 + cfb9c6d commit fb87398
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -14,4 +14,4 @@ script: phpunit -d memory_limit=1024M

matrix:
allow_failures:
- hhvm
- php: hhvm
14 changes: 10 additions & 4 deletions src/Illuminate/Database/QueryException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php namespace Illuminate\Database;

class QueryException extends \PDOException {
use PDOException;

class QueryException extends PDOException {

/**
* The SQL for the query.
@@ -21,7 +23,7 @@ class QueryException extends \PDOException {
*
* @param string $sql
* @param array $bindings
* @param \PDOException $previous
* @param \Exception $previous
* @return void
*/
public function __construct($sql, array $bindings, $previous)
@@ -30,16 +32,20 @@ public function __construct($sql, array $bindings, $previous)
$this->bindings = $bindings;
$this->previous = $previous;
$this->code = $previous->getCode();
$this->errorInfo = $previous->errorInfo;
$this->message = $this->formatMessage($sql, $bindings, $previous);

if ($previous instanceof PDOException)
{
$this->errorInfo = $previous->errorInfo;
}
}

/**
* Format the SQL error message.
*
* @param string $sql
* @param array $bindings
* @param \PDOException $previous
* @param \Exception $previous
* @return string
*/
protected function formatMessage($sql, $bindings, $previous)

0 comments on commit fb87398

Please sign in to comment.