-
Notifications
You must be signed in to change notification settings - Fork 145
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
Catching errors #114
Comments
Ah, this is quite a complex issue! I would expect Do you have any ideas about how we should improve this? |
It seems to me that FRP and exceptions do not mix well. Instead exceptions should be captured in the types. |
@3noch Yes, definitely. My favorite approach, by far, to exceptions has been to avoid them completely. However, that doesn't mean we wouldn't be better off if we had a decent system for dealing with them when they (hopefully occasionally) do crop up! |
Ah, right, that'll be it.
@ryantrinkle for the beginning it would probably be enough (or at least very very helpful) if I can pass in an exception handler at the
I'd like to, but when using lots of standard Hackage/base libraries, it's unavoidable that you trip over one that eventually uses a partial function / |
@ryantrinkle Ah yes I totally agree. In my limited use cases, I've always wrapped my |
@3noch I don't believe there are any reflex-dom functions that are partial in their own right. However, there's always the possibility of a divide-by-zero or something like that cropping up in user code or by accident in reflex-dom. One important thing to note is that reflex itself does not currently recover from exceptions during event propagation. Now, event propagation doesn't do IO, so it shouldn't be very likely to run into issues, but divide by zero is still possible. |
@ryantrinkle If the exceptions bubbled up to |
I'd like to perform an action when any part of my
reflex-dom
application throws an action.I noticed that
Control.Exception.handle
at the top level doesn't seem to work, because apparently if an exception flies inwidgetHold
's second argument, it never bubbles up any more; instead onlyconsole.log(str);
fromfunction h$errorMsg(pat) {
is invoked and myerror
message is printed to the developer console.Is this what's supposed to happen?
Thanks!
The text was updated successfully, but these errors were encountered: