在我的 Laravel 包中,我有以下代码:
try {
$var_msg = "Exception example";
throw new InvalidNameException($var_msg);
}
catch (InvalidNameException $e) {
abort(403, $e->getMessage());
//report($e);Exception Log
}
错误显示为 html 错误页面。但是,我想将该错误报告为糟糕的错误。