Handler::report()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 15
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
dl 0
loc 15
c 2
b 0
f 1
rs 9.4285
cc 2
eloc 8
nc 2
nop 1
1
<?php namespace App\Exceptions;
2
3
use Exception;
4
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
5
6
class Handler extends ExceptionHandler {
7
8
	/**
9
	 * A list of the exception types that should not be reported.
10
	 *
11
	 * @var array
12
	 */
13
	protected $dontReport = [
14
		'Symfony\Component\HttpKernel\Exception\HttpException'
15
	];
16
17
	/**
18
	 * Report or log an exception.
19
	 *
20
	 * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
21
	 *
22
	 * @param  \Exception  $e
23
	 * @return void
24
	 */
25
	public function report(Exception $e)
26
	{
27
		// some quick data about the error for local development
28
		if (\App::environment('local')) {
29
			
30
			die(
0 ignored issues
show
Coding Style Compatibility introduced by
The method report() contains an exit expression.

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.

Loading history...
31
				"File: " . $e->getFile() . 
32
				"\nLine: " . $e->getLine() . 
33
				"\nMessage: " . $e->getMessage() . 
34
				"\n\nTrace:\n" . substr($e->getTraceAsString(), 0, 25000)
35
			);
36
		}
37
38
		return parent::report($e);
39
	}
40
41
	/**
42
	 * Render an exception into an HTTP response.
43
	 *
44
	 * @param  \Illuminate\Http\Request  $request
45
	 * @param  \Exception  $e
46
	 * @return \Illuminate\Http\Response
47
	 */
48
	public function render($request, Exception $e)
49
	{
50
		return parent::render($request, $e);
51
	}
52
53
}
54