You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is very counter-intuitive. I wonder how can I solve this problem? In other words, I want to have the full stack trace (so I use capture), but at the same time, I want catch to work!
Thanks for any suggestions!
The text was updated successfully, but these errors were encountered:
Chain.capture creates a new error zone and runs the given function in it, if invoked with the default arguments. Errors cannot cross error zones, so awaiting the result of Chain.capture cannot catch errors and any errors are unhandled exceptions in the error zone created by Chain.capture.
You can disable the creation of a new error zone with Chain.capture(..., errorZone: false).
Very simple example:
As expected, the output is
catch e=Exception: fake error
.However, by wrapping
g
withChain.capture
as follows:Our catch no longer works! See below:
This is very counter-intuitive. I wonder how can I solve this problem? In other words, I want to have the full stack trace (so I use capture), but at the same time, I want
catch
to work!Thanks for any suggestions!
The text was updated successfully, but these errors were encountered: