diff --git a/laravel/database/exception.php b/laravel/database/exception.php index d8f425a5..d9d390b4 100644 --- a/laravel/database/exception.php +++ b/laravel/database/exception.php @@ -22,6 +22,9 @@ public function __construct($sql, $bindings, \Exception $inner) $this->inner = $inner; $this->setMessage($sql, $bindings); + + // Set the exception code + $this->code = $inner->getCode(); } /** @@ -47,5 +50,5 @@ protected function setMessage($sql, $bindings) $this->message .= "\n\nSQL: ".$sql."\n\nBindings: ".var_export($bindings, true); } - + } \ No newline at end of file