Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | 1 | public function reportRollbar(Throwable $exception): void |
|
14 | { |
||
15 | 1 | $discardClasses = (array) $this->app->config->get('rollbar.discard_classes', []); |
|
16 | 1 | foreach ($discardClasses as $class) { |
|
17 | // If the exception is an instance of a class that should be ignored, |
||
18 | // do not log it |
||
19 | 1 | if ($exception instanceof $class) { |
|
20 | 1 | return; |
|
21 | } |
||
22 | } |
||
23 | |||
24 | 1 | Rollbar::log(Level::ERROR, $exception->getMessage(), [ |
|
25 | 1 | 'exception' => $exception, |
|
26 | 1 | 'trace' => $exception->getTraceAsString(), |
|
27 | 1 | ]); |
|
30 |