使用相关文档安装 Laravel 和 Bugsnag 后,我发现NotFoundHttpException
错误没有报告给 Bugsnag(但是notifyError
是的)。我的问题是如何设置它以便报告所有错误,而不是一遍又一遍地使用这些行:
Bugsnag::notifyError('ErrorType', 'Something bad happened');
或者
try {
// Some potentially crashy code
} catch (Exception $ex) {
Bugsnag::notifyException($ex);
}
我正在考虑像这样使用Handler
in app/exceptions
:
public function report(Exception $e)
{
Bugsnag::notifyException($e);
parent::report($e);
}
但是如果 Laravel/Bugsnag 集成文档中没有提到它,这是一个好习惯吗?这个Laracast 视频没有描述对异常处理程序的任何更改,并且设置似乎按预期工作。