forked from ReactiveX/RxJava
-
Notifications
You must be signed in to change notification settings - Fork 0
Error Handling Operators
David Gross edited this page Jan 12, 2015
·
28 revisions
There are a variety of operators that you can use to react to or recover from onError
notifications from Observables. For example, you might:
- swallow the error and switch over to a backup Observable to continue the sequence
- swallow the error and emit a default item
- swallow the error and immediately try to restart the failed Observable
- swallow the error and try to restart the failed Observable after some back-off interval
The following pages explain these operators.
-
onErrorResumeNext( )
— instructs an Observable to emit a sequence of items if it encounters an error -
onErrorReturn( )
— instructs an Observable to emit a particular item when it encounters an error -
onExceptionResumeNext( )
— instructs an Observable to continue emitting items after it encounters an exception (but not another variety of throwable) -
retry( )
— if a source Observable emits an error, resubscribe to it in the hopes that it will complete without error -
retryWhen( )
— if a source Observable emits an error, pass that error to another Observable to determine whether to resubscribe to the source
A Netflix Original Production
Tech Blog | Twitter @NetflixOSS | Twitter @RxJava | Jobs
- Introduction
- Getting Started
- JavaDoc
- How to Use RxJava
- Additional Reading
- The Observable
- Operators (Alphabetical List)
- Async
- Blocking Observable
- Combining
- Conditional & Boolean
- Connectable Observable
- Error Handling
- Filtering
- Mathematical and Aggregate
- Observable Creation
- String
- Transformational
- Utility Operators
- Implementing Custom Operators, previous
- Backpressure
- Error Handling
- Plugins
- Schedulers
- Subjects
- The RxJava Android Module
- RxJava 2.0
- How to Contribute