Support the ongoing development of Laravel.io →
posted 8 years ago
Requests
Last updated 2 years 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 8 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 8 years ago.
0

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

0

Sign in to participate in this thread!

Eventy

Your banner here too?

VenomRush venomrush Joined 27 May 2014

Moderators

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

Your logo here?

Laravel.io

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

© 2024 Laravel.io - All rights reserved.