Show previous exception #345
Unanswered
driesvints
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I recently experienced a view exception where the actual bug wasn't shown. It was hidden in the stacktrace of the previous exception that the main exception was carrying so the actual bug wasn't present on the Ignition screen.
To give you more context this, for example, happens when an exception is thrown in a Blade view. Laravel will catch that exception, wrap it in its own
ErrorException
and add the line where it happened to the exception message. Because the exception that was thrown is added to theErrorException
as a previous exception, the stack trace of the newErrorException
doesn't always shows the exact spot where the bug happened.Here's the code that was added by Taylor that added this functionality (dates back to 2013): laravel/framework@bccc3fb
Now, one thing we recently did in Laravel is to at least convert the
ErrorException
into a dedicatedViewException
so you can specifically handle this case. You can check out this PR which I sent in. The PR fixes a use case to pipe through therender
andreport
methods for a previous exception thrown. (related to https://github.com/facade/ignition/issues/339)Now what I believe would be a good addition to Ignition is to add a way that the Ignition screen shows the previous exception stacktrace as well as this could provide extra information on how a bug occurred. I wouldn't tie this into specifically the
ViewException
which was added in the above mentioned PR but make it a generic solution so all types of exceptions are being handled this way.This probably involves some UI adjustments. As that's not really my cup of tea I'll leave it over to you to decide how you'd like to handle that properly.
I really believe this could be a valuable addition for Ignition (and Flare in extend). Especially since you currently have situations where an exception report doesn't always shows the exact information you need.
Anyway, let me know what you think.
Beta Was this translation helpful? Give feedback.
All reactions