Skip to content

Commit

Permalink
Refactor exception handler to return null in local environment
Browse files Browse the repository at this point in the history
  • Loading branch information
ewilan-riviere committed Jan 27, 2024
1 parent 8e9ea2f commit e821c65
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Utils/Journal.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,12 @@ public static function error(string $message, array $data = []): self
/**
* Handle exception, log as error and send notification to database.
*/
public static function handler(\Throwable $e): self
public static function handler(\Throwable $e): ?self
{
if (config('app.env') === 'local') {
return null;
}

return new self($e->getMessage(), 'error', [
'file' => $e->getFile(),
'line' => $e->getLine(),
Expand Down

0 comments on commit e821c65

Please sign in to comment.