Skip to content

Conversation

@jaxwilko
Copy link
Member

This PR modifies how the details of an exeception are processed to allow us to display more information on the "Error Log" page.

@mjauvin
Copy link
Member

mjauvin commented Feb 10, 2025

Nice!

@jaxwilko
Copy link
Member Author

@mjauvin ;)

image
image

@jaxwilko jaxwilko requested a review from LukeTowers February 12, 2025 14:40
@LukeTowers LukeTowers added this to the 1.2.8 milestone Feb 13, 2025
@LukeTowers LukeTowers merged commit 2dc3501 into develop Feb 13, 2025
10 checks passed
@LukeTowers LukeTowers deleted the wip/better-error-logging branch February 13, 2025 05:11
LukeTowers pushed a commit to wintercms/winter that referenced this pull request Feb 13, 2025
Co-authored-by: Luke Towers <git@luketowers.ca>
Related: wintercms/storm#204

This adds a fully backwards compatible "v2" log viewer that allows of unrolling of all previous exceptions. It also adds snippets for each frame in the call stack and extra information about the environment is recorded and displayed to the user.

This is a stopgap solution until we get around to fully implementing the Ignition error page in Winter CMS core and displaying stored errors with that instead.
bennothommo pushed a commit to wintercms/wn-system-module that referenced this pull request Feb 13, 2025
Co-authored-by: Luke Towers <git@luketowers.ca>
Related: wintercms/storm#204

This adds a fully backwards compatible "v2" log viewer that allows of unrolling of all previous exceptions. It also adds snippets for each frame in the call stack and extra information about the environment is recorded and displayed to the user.

This is a stopgap solution until we get around to fully implementing the Ignition error page in Winter CMS core and displaying stored errors with that instead.
bennothommo pushed a commit to wintercms/wn-cms-module that referenced this pull request Feb 13, 2025
Co-authored-by: Luke Towers <git@luketowers.ca>
Related: wintercms/storm#204

This adds a fully backwards compatible "v2" log viewer that allows of unrolling of all previous exceptions. It also adds snippets for each frame in the call stack and extra information about the environment is recorded and displayed to the user.

This is a stopgap solution until we get around to fully implementing the Ignition error page in Winter CMS core and displaying stored errors with that instead.
@bennothommo
Copy link
Member

@jaxwilko @LukeTowers not sure if this was accounted for in this PR already, but it appears closures have more context now in a backtrace. See #203 (comment) for more info - it broke the relation name auto-guessing.

Might be useful though for providing more context in the new backtraces.

@jaxwilko
Copy link
Member Author

@bennothommo the issue is unless the Closure is passed as an argument, we do not have access to it from the stack trace, for example with this code:

image

We get this trace:

image

If the php logic does pass the Closure as an argument, such as:

image

The we would gain access to the object:

image

But we cannot 100% confirm that the Closure executed later in the trace is the Closure that was previously passed.

While it would be really cool to add this logic, I'm not sure how we could extract the object reliably enough to consistantly generate the snippet (or even to display any extra data).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants