Skip to content
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

Improve exception debugging by removing catch and rethrow from re-frame's router #627

Open
mike-thompson-day8 opened this issue Jul 5, 2020 · 1 comment

Comments

@mike-thompson-day8
Copy link
Contributor

mike-thompson-day8 commented Jul 5, 2020

I have verbally received the following suggestion, which is aimed at making it easier to debug event handlers when they throw exceptions ...

Currently, when an exception is thrown in an event handler, it is caught by the re-frame router, which does some cleanup, and then rethrows. This catch and rethrow business is a nuisance - it adds a little sand into the gears. And it probably isn't actually needed - can it be removed?

Why? Chrome's devtools will break on uncaught exceptions, which is good. It will give you the call stack and locals at the throw point. But when the exception is rethrown (as is the case in re-frame event handlers) it is the rethrow point which is reported - what we'd like is for devtools to stop at the original throw point (the event handler) and not the rethrow point (deep in the guts of re-frame's router)

@mike-thompson-day8
Copy link
Contributor Author

Unfortunately, the PR Isaac and I developed to mitigate this issue makes the router code ugly and a bit fragile. I am not keen to merge it. We'll have to think of a better way to achieve this or abandon this requirement.

kimo-k added a commit that referenced this issue Nov 3, 2023
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

No branches or pull requests

1 participant