File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,15 @@ launchAff :: forall e a. Aff e a -> Eff (err :: EXCEPTION | e) Unit
8585Converts the asynchronous computation into a synchronous one. All values
8686are ignored, and if the computation produces an error, it is thrown.
8787
88+ Catching exceptions by using ` catchException ` with the resulting Eff
89+ computation is not recommended, as exceptions may end up being thrown in
90+ a different thread, due to the asynchronous nature of Aff. In such a
91+ case, the exception cannot be caught.
92+
93+ If you do need to handle exceptions, you can use ` runAff ` instead, or
94+ you can handle the exception within the Aff computation, using
95+ ` catchError ` (or any of the other mechanisms).
96+
8897#### ` runAff `
8998
9099``` purescript
Original file line number Diff line number Diff line change @@ -66,6 +66,15 @@ module Control.Monad.Aff
6666
6767 -- | Converts the asynchronous computation into a synchronous one. All values
6868 -- | are ignored, and if the computation produces an error, it is thrown.
69+ -- |
70+ -- | Catching exceptions by using `catchException` with the resulting Eff
71+ -- | computation is not recommended, as exceptions may end up being thrown in
72+ -- | a different thread, due to the asynchronous nature of Aff. In such a
73+ -- | case, the exception cannot be caught.
74+ -- |
75+ -- | If you do need to handle exceptions, you can use `runAff` instead, or
76+ -- | you can handle the exception within the Aff computation, using
77+ -- | `catchError` (or any of the other mechanisms).
6978 launchAff :: forall e a. Aff e a -> Eff (err :: EXCEPTION | e ) Unit
7079 launchAff = runAff throwException (const (pure unit)) <<< liftEx
7180 where
You can’t perform that action at this time.
0 commit comments