Commit 752161ca authored by arisk's avatar arisk

Setting the exception code in the constructor

parent e541cf9e
......@@ -22,7 +22,9 @@ class Exception extends \Exception {
$this->inner = $inner;
$this->setMessage($sql, $bindings);
$this->setCode();
// Set the exception code
$this->code = $inner->getCode();
}
/**
......@@ -39,14 +41,4 @@ 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();
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment