I have this function that runs with Fable, fetching some data from a server then processing it:
let fetchData () = promise { // unit Fable.Core.JS.Promise<Result<DecodedData,string>>
let! response = Fetch.fetch "http://localhost:8080/api/" []
let! body = response.text()
return decodeData body
}
How do I handle exceptions from the let!'s and return them as Error “Error messages”? Currently they are thrown as exceptions which the caller of the function must handle.