-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
How should error handlers treat Fatal errors? #59
Comments
Note that |
Hm, now that you mention it, it does sound like all our error checks should only match non fatal errors. That's what Monix seems to do for example. Aside from UndefinedBehaviorError, I'm not sure if there are any special scala.js considerations for handling NonFatal errors (plain JS has no observable concept of special fatal errors as far as I know). |
I am not even sure if The Scala JS documentation also states
This leads me to believe that we should check for |
UndefinedBehaviorError certainly exists, you can get it in fastOpt when e.g. you call
Do you mean because of "the list will probably expand in future versions" part? Because the two mentioned exceptions are regular runtime exceptions, not fatal. I wonder why ZIO behaves that way. Maybe they're onto something. The canonical argument for only catching NonFatal exceptions is to let the program crash and burn, but with asynchronous programming in JS "crash and burn" just means that the currently executing "message" (in event loop terms) will terminate. This will cause I'm not sure what's the right thing to do in scala.js. Current situation is not great because Scala's |
Yes. We can keep the issue open for now. |
As per Scala JS semantics,
Does this imply that error handlers such as the one in
EventStream.fireValue
should be modified to handle onlyNonFatal
errors?The text was updated successfully, but these errors were encountered: