Skip to content

Commit

Permalink
[10.x] Add Method to Report only logged exceptions (#47554)
Browse files Browse the repository at this point in the history
* add report error

* Fix linting

* fix linting

* rename method

---------

Co-authored-by: Taylor Otwell <[email protected]>
  • Loading branch information
joelharkes and taylorotwell authored Jun 26, 2023
1 parent be745b8 commit 9f366f6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Illuminate/Foundation/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,19 @@ public function report(Throwable $e)
return;
}

$this->reportThrowable($e);
}

/**
* Reports error based on report method on exception or to logger.
*
* @param \Throwable $e
* @return void
*
* @throws \Throwable
*/
protected function reportThrowable(Throwable $e): void
{
if (Reflector::isCallable($reportCallable = [$e, 'report']) &&
$this->container->call($reportCallable) !== false) {
return;
Expand Down

0 comments on commit 9f366f6

Please sign in to comment.