Chapter 7. Error handling with RxJS
This chapter covers
- The issues with imperative error–handling schemes
- Using functional data types to abstract exception handling
- Using observable operators to handle exceptions
- Different strategies for retrying observable sequences
Until now, we’ve explored only happy-path examples involving RxJS for tackling many different use cases. We suspect that at some point you’ve probably asked yourself, “What would happen if a remote HTTP call failed while fetching data for my stock quote widget?” Observers see the outcome of combining and transforming sequences of streams that you use to map your business logic to. But if an exception occurs midstream, what will the observer see at that point? These are some valid and important questions, but it was important that you first understand and learn to think reactively with ideal scenarios. Now, we’re going to sprinkle a dose of the real world onto your code. The brutal reality is that software will likely fail at some point during its execution.