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
85
85
Converts the asynchronous computation into a synchronous one. All values
86
86
are ignored, and if the computation produces an error, it is thrown.
87
87
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
+
88
97
#### ` runAff `
89
98
90
99
``` purescript
Original file line number Diff line number Diff line change @@ -66,6 +66,15 @@ module Control.Monad.Aff
66
66
67
67
-- | Converts the asynchronous computation into a synchronous one. All values
68
68
-- | 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).
69
78
launchAff :: forall e a. Aff e a -> Eff (err :: EXCEPTION | e ) Unit
70
79
launchAff = runAff throwException (const (pure unit)) <<< liftEx
71
80
where
You can’t perform that action at this time.
0 commit comments