loading...

re: Creating a Functional Wrapper in F# VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Great article, trying to wrap my had around F# this days and articles like that, real world scenarios like wrapping third party dlls or my own for ...
 

Thanks for the reply, glad you liked it. The error handling is no different than it would be in C# here: callers would need to be prepared to handle HttpRequestException (or an AggregateException with an inner HttpRequestException due to the Task) for network errors, and TaskCanceledException if you're using timeouts.

In my own code I often catch and convert those exceptions to Results, but that's somewhat opinionated and felt beyond the scope of this post.

Also, non-200 status codes will not throw and can be handled through pattern matching

 

Thanks for finding the time to reply,
much appriciated

code of conduct - report abuse