-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEAT] Adds better logging for render errors #1169
Conversation
pzuraq
commented
Sep 30, 2020
•
edited
Loading
edited
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chatted with @pzuraq offline, we should migrate this away from try
/catch
back to using try
/finally
. As a try
/catch
we somewhat fundamentally break developer ergonomics (when using "break on uncaught exceptions" it should stop in userland helper code, not our own internals).
The original need that caused this to be moved to try
/catch
was the deopts that were being triggered in that code that should only be ran when there is an actual exception. We can avoid that same issue by doing something akin to this instead:
let didError = true;
try {
doSomething();
didError = false;
} finally {
if (didError) {
console.log('error yo!')
}
}
Doing this avoids the dev ergonomics issues and the deopt that was the original reason for moving to try
/catch
.
In this context, I think we should change this PR from assigning e.message
to directly console.log
'ing instead.
For those that are curious, here is a smallish codepen that demos the dev ergonomics issue I was referring to: https://codepen.io/rwjblue/full/PozYKqw. When you run it, make sure to have DevTools open and "Pause on uncaught exceptions" set in the sources tab. The execution should pause in the |
#1172 addresses the removal of |
kk, ready for a rebase / rework now @pzuraq |
46b6765
to
87e7488
Compare
Adds an error log that provides context to the user when an error occurs during rendering.
87e7488
to
67df831
Compare
Fixes two major issues: * Ensure "pause on uncaught" exceptions pauses in correct location (glimmerjs/glimmer-vm#1172) * Log template heirarchy to the console for any errors thrown during rendering (glimmerjs/glimmer-vm#1169)
Fixes two major issues: * Ensure "pause on uncaught" exceptions pauses in correct location (glimmerjs/glimmer-vm#1172) * Log template heirarchy to the console for any errors thrown during rendering (glimmerjs/glimmer-vm#1169) (cherry picked from commit e8cfd08)
Fixes two major issues: * Ensure "pause on uncaught" exceptions pauses in correct location (glimmerjs/glimmer-vm#1172) * Log template heirarchy to the console for any errors thrown during rendering (glimmerjs/glimmer-vm#1169)