framework icon indicating copy to clipboard operation
framework copied to clipboard

Exception render does not expose previous exceptions

Open DarkGhostHunter opened this issue 2 months ago • 2 comments

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

  1. Throw an Exception with a previous Throwable exception.
  2. Watch the rendered exception response not showing the previous exception.

DarkGhostHunter avatar Oct 13 '25 02:10 DarkGhostHunter