Browse Source

异常报告

master
shuixiang 4 years ago
parent
commit
1b12c899dc
  1. 9
      app/Exceptions/Handler.php

9
app/Exceptions/Handler.php

@ -36,11 +36,7 @@ class Handler extends ExceptionHandler
*/ */
public function register() public function register()
{ {
$this->reportable(function (Throwable $e) {
if ($this->shouldReport($e) && app()->bound('sentry')) {
app('sentry')->captureException($e);
}
});
//
} }
/** /**
@ -49,6 +45,9 @@ class Handler extends ExceptionHandler
*/ */
public function report(Throwable $e): bool public function report(Throwable $e): bool
{ {
if ($this->shouldReport($e) && app()->bound('sentry')) {
app('sentry')->captureException($e);
}
// 判断异常是否需要自定义报告... // 判断异常是否需要自定义报告...
return false; return false;
} }

Loading…
Cancel
Save