Support the ongoing development of Laravel.io →
Requests
Last updated 2 weeks ago.
0

i don't think you need a custom handler, since if you check the app\bootstrap\app.php you'll find a singleton bound to the App\Exceptions\Handler::class where in the render method you could handle everything.

add you exception class to the protected $dontReport array

and in the render method do something like

if ($e instanceof ModelNotFoundException) {
    $e = new NotFoundHttpException($e->getMessage(), $e);
}
Last updated 5 years ago.
0

I can't find any instance of a handle() method in any of the classes relevant to the App\Exceptions\Handler::class. Where can I find this method?

Last updated 5 years ago.
0

i meant the render method, there's not handle method. sorry

0

Sign in to participate in this thread!

LaraJobs

Your banner here too?

VenomRush VenomRush venomrush Joined 27 May 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.