catch
Task.catch
Task<'a> -> Task<Choice<'a, exn>>Examples
let taskThrow () =
task {
failwith "something bad happened"
return Error ""
}Example 1
let result = Task.catch (Task.singleton 42)
// task { Choice1Of2(42) }Example 2
let result = Task.catch (taskThrow ())
// task { Choice2Of2(exn("something bad happened")) }Last updated