Replies: 3 comments
-
So turns out F# when an exception is thrown inside an asynchronous computation expression (CE), it is not caught by a try statement that surrounds the CE. This is because asynchronous computations are executed on a separate thread or thread pool, and the exception is thrown on that thread, which is outside the scope of the try block. To catch exceptions in an asynchronous computation expression, you can use the Async.Catch function. This function takes an asynchronous computation expression as an argument and returns a new asynchronous computation expression that catches any exceptions thrown by the original computation. |
Beta Was this translation helpful? Give feedback.
-
It's still not working if I use Async.Catch |
Beta Was this translation helpful? Give feedback.
-
Can you share a full code sample? Have you tried using native F# task CE's? |
Beta Was this translation helpful? Give feedback.
-
is it because I am black
Beta Was this translation helpful? Give feedback.
All reactions