Skip to content

Commit 33c3fe1

Browse files
committed
wip
1 parent 9589dec commit 33c3fe1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

errors.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,20 @@ class PodcastProcessingException extends Exception implements ShouldntReport
203203
}
204204
```
205205

206+
If you need even more control over when a particular type of exception is ignored, you may provide a closure to the `dontReportWhen` method:
207+
208+
```php
209+
use App\Exceptions\InvalidOrderException;
210+
use Throwable;
211+
212+
->withExceptions(function (Exceptions $exceptions) {
213+
$exceptions->dontReportWhen(function (Throwable $e) {
214+
return $e instanceof PodcastProcessingException &&
215+
$e->reason() === 'Subscription expired';
216+
});
217+
})
218+
```
219+
206220
Internally, Laravel already ignores some types of errors for you, such as exceptions resulting from 404 HTTP errors or 419 HTTP responses generated by invalid CSRF tokens. If you would like to instruct Laravel to stop ignoring a given type of exception, you may use the `stopIgnoring` exception method in your application's `bootstrap/app.php` file:
207221

208222
```php

0 commit comments

Comments
 (0)