1 | <?php |
||
12 | class Handler extends ExceptionHandler |
||
13 | { |
||
14 | /** |
||
15 | * A list of the exception types that should not be reported. |
||
16 | * |
||
17 | * @var array |
||
18 | */ |
||
19 | protected $dontReport = [ |
||
20 | HttpException::class, |
||
21 | ModelNotFoundException::class, |
||
22 | ]; |
||
23 | |||
24 | /** |
||
25 | * Report or log an exception. |
||
26 | * |
||
27 | * This is a great spot to send exceptions to Sentry, Bugsnag, etc. |
||
28 | * |
||
29 | * @param \Exception $e |
||
30 | * @return void |
||
31 | */ |
||
32 | public function report(Exception $e) |
||
36 | |||
37 | /** |
||
38 | * Render an exception into an HTTP response. |
||
39 | * |
||
40 | * @param \Illuminate\Http\Request $request |
||
41 | * @param \Exception $e |
||
42 | * @return \Illuminate\Http\Response |
||
43 | */ |
||
44 | public function render($request, Exception $e) |
||
58 | } |
||
59 |
An exit expression should only be used in rare cases. For example, if you write a short command line script.
In most cases however, using an
exit
expression makes the code untestable and often causes incompatibilities with other libraries. Thus, unless you are absolutely sure it is required here, we recommend to refactor your code to avoid its usage.