Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Logging: Exception Handler
- Loading branch information
1 parent
d751414
commit 95600c7
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
src/A1comms/GaeSupportLaravel/Foundation/Exceptions/Handler.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace A1comms\GaeSupportLaravel\Foundation\Exceptions; | ||
|
||
use Exception; | ||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; | ||
use A1comms\GaeSupportLaravel\Integration\ErrorReporting\Report as ErrorBootstrap; | ||
|
||
class Handler extends ExceptionHandler | ||
{ | ||
/** | ||
* Report or log an exception. | ||
* | ||
* This is a great spot to send exceptions to Sentry, Bugsnag, etc. | ||
* | ||
* @param \Exception $exception | ||
* @return void | ||
*/ | ||
public function report(Exception $exception) | ||
{ | ||
parent::report($exception); | ||
|
||
// Log the error out to Stackdriver Error Reporting. | ||
if ($this->shouldReport($e)) { | ||
try { | ||
ErrorBootstrap::exceptionHandler($e); | ||
} catch (Exception $ex) { | ||
|
||
} | ||
} | ||
} | ||
} |