Intro to Rx - Advanced error handling
Using marble diagrams, we will examine various ways to handle different control flows. Just as with normal .NET code, we have flow control constructs such as try
/catch
/finally
. In this chapter we see how they can be applied to observable sequences.
Catch
Just like a catch in SEH (Structured Exception Handling), with Rx you have the option of swallowing an exception, wrapping it in another exception or performing some other logic.
We already know that observable sequences can handle erroneous situations with the OnError construct. A useful method in Rx for handling an OnError notification is the Catch extension method. Catch allows you to intercept a specific Exception type and then continue with another sequence.
Below is the signature for the simple overload of catch:
Read full article from Intro to Rx - Advanced error handling
No comments:
Post a Comment