Added PDO error code
This commit is contained in:
@@ -22,6 +22,7 @@ class Exception extends \Exception {
|
||||
$this->inner = $inner;
|
||||
|
||||
$this->setMessage($sql, $bindings);
|
||||
$this->setCode();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -37,5 +38,15 @@ class Exception extends \Exception {
|
||||
|
||||
$this->message .= "\n\nSQL: ".$sql."\n\nBindings: ".var_export($bindings, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the exception code.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setCode()
|
||||
{
|
||||
$this->code = $this->inner->getCode();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user