Exception render does not expose previous exceptions
Laravel Version
12.x
PHP Version
8.4
Database Driver & Version
N/A
Description
Some exceptions rendered by libraries or the application itself may include the previous exception that triggered it.
When the exception is rendered by Laravel as a response, there is no way to know the previous exception or track the previous exceptions from there. This turns a simple one minute debug line into an one hour investigation to know what triggers it.
My suggestion is to add an accordion with all the "previous" exceptions, much like the Exception Trace accordion, if it exists. It should travel until there $exception->getPrevious() returns empty.
Steps To Reproduce
- Throw an Exception with a previous
Throwableexception. - Watch the rendered exception response not showing the previous exception.
Hi @DarkGhostHunter,
Thanks for reporting this. Could you please provide a minimal example or a small repository that reproduces the issue? That would help confirm the behavior and make it easier to evaluate your suggestion.
Hi @DarkGhostHunter,
Thanks for reporting this. Could you please provide a minimal example or a small repository that reproduces the issue? That would help confirm the behavior and make it easier to evaluate your suggestion.
Throw an exception with a previous exception on your favourite project?