-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Safer re-throw semantics for fork (and tests)
Ignoring ThreadKilled was a good idea, but we should not throw async'ly anything that is not a member of SomeAsyncException. It will not play well with code that likes to catch all sync exception types. Wrap all sync exceptions in an async wrapper before throwing async'ly (since all async exceptions are PseudoException, this will continue to prevent fromIO from catching it as well). The only special case is ExitCode. This is still somewhat dangerous (some over-eager exception-catching mechanisms will catch this when thrown to the parent async'ly, and likely do the wrong thing) but the trade-off seems worth it since when you have an ExitCode you really want it to reach the top and exit the process with that code, not crash the process with an async exception wrapper.
- Loading branch information
1 parent
bddede0
commit 7c5c6b7
Showing
2 changed files
with
81 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters