Skip to Content
Hands-On Reactive Programming with Python
book

Hands-On Reactive Programming with Python

by Romain Picard
October 2018
Intermediate to advanced
420 pages
10h 26m
English
Packt Publishing
Content preview from Hands-On Reactive Programming with Python

Error handling

ReactiveX provides several ways to deal with errors. As explained in Chapter 1, An Introduction to Reactive Programming, errors are not special in a ReactiveX code flow. Rather, an error in ReactiveX is one possible way to end an observable. The other way is to complete it (which means that it has succeeded). There are two ways to deal with errors, depending on where the error is caught in the operators chain, as follows:

  • An observer handles errors in its on_error callback or method
  • A chain of operators can use dedicated operators to deal with errors

The first case is something that must be done in all cases. If a single observer does not handle errors then the errors go to a black hole. This is an easy way to waste hours ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python Programming with Design Patterns

Python Programming with Design Patterns

James W. Cooper

Publisher Resources

ISBN: 9781789138726Supplemental Content