Skip to content

Commit 24e0fb8

Browse files
committed
add stopIgnoring method
1 parent 48ed0eb commit 24e0fb8

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/Illuminate/Foundation/Exceptions/Handler.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,23 @@ protected function shouldntReport(Throwable $e)
299299
return ! is_null(Arr::first($dontReport, fn ($type) => $e instanceof $type));
300300
}
301301

302+
/**
303+
* Remove the given exception class from the list of exceptions that should be ignored.
304+
*
305+
* @param string $exception
306+
* @return $this
307+
*/
308+
public function stopIgnoring(string $exception)
309+
{
310+
$this->dontReport = collect($this->dontReport)
311+
->reject(fn ($ignored) => $ignored === $exception)->values()->all();
312+
313+
$this->internalDontReport = collect($this->internalDontReport)
314+
->reject(fn ($ignored) => $ignored === $exception)->values()->all();
315+
316+
return $this;
317+
}
318+
302319
/**
303320
* Create the context array for logging the given exception.
304321
*

0 commit comments

Comments
 (0)