Custom exception handlers let you define the behavior of your application when a specific exception is thrown.
By default you can add your custom handlers in app/Exceptions/Handler.php
, but the more handlers you add the more this class gets cluttered and difficult to read.
Furthermore it is not possible for an external Laravel package to automatically register how its custom exceptions should be handled by the application where it is being installed.
This is where this package comes in handy, it lets you register your custom exception handlers by using service providers, so that also external packages may register their own.
This package leverages the decorators design pattern, which let you keep using the Laravel default handler as you normally would. It just wraps the Handler class to extend its functionalities.
For further information, please have a look at the package on GitHub. Any feedback is welcome, thank you :)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community