OnErrorExtensions<T> extension
Extends the Stream class with the ability to recover from errors in various ways
- on
-
- Stream<
T>
- Stream<
Methods
-
onErrorResume(
Stream< T> recoveryFn(Object error, StackTrace stackTrace)) → Stream<T> -
Intercepts error events and switches to a recovery stream created by the
provided
recoveryFn
. -
onErrorResumeNext(
Stream< T> recoveryStream) → Stream<T> - Intercepts error events and switches to the given recovery stream in that case
-
onErrorReturn(
T returnValue) → Stream< T> - Instructs a Stream to emit a particular item when it encounters an error, and then terminate normally
-
onErrorReturnWith(
T returnFn(Object error, StackTrace stackTrace)) → Stream< T> -
Instructs a Stream to emit a particular item created by the
returnFn
when it encounters an error, and then terminate normally.