Skip to content

Commit aa59802

Browse files
committed
Better implementation for feedback
1 parent ec33006 commit aa59802

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

examples/laravel-5.2/app/Exceptions/Handler.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ class Handler extends ExceptionHandler
2323
ValidationException::class,
2424
];
2525

26+
private $sentryID;
27+
2628
/**
2729
* Report or log an exception.
2830
*
@@ -34,7 +36,7 @@ class Handler extends ExceptionHandler
3436
public function report(Exception $e)
3537
{
3638
if ($this->shouldReport($e)) {
37-
app('sentry')->captureException($e);
39+
$this->sentryID = app('sentry')->captureException($e);
3840
}
3941
parent::report($e);
4042
}
@@ -48,9 +50,8 @@ public function report(Exception $e)
4850
*/
4951
public function render($request, Exception $e)
5052
{
51-
// return parent::render($request, $e);
5253
return response()->view('errors.500', [
53-
'sentryID' => app('sentry')->getLastEventID(),
54+
'sentryID' => $this->sentryID,
5455
], 500);
5556
}
5657
}

0 commit comments

Comments
 (0)