public static interface Stage.OnErrorResume extends Stage
By default, when a stream encounters an error that prevents it from emitting the expected item to its
subscriber, the stream (publisher) invokes its subscriber's onError method, and then terminates
without invoking any more of its subscriber's methods. This operator changes this behavior. If the current
stream encounters an error, instead of invoking its subscriber's onError method, it will instead
emit the return value of the passed function. This operator prevents errors from propagating and allows
supplying fallback data should errors be encountered.
Any RuntimeException thrown by the function must be propagated downstream as an error, replacing the
exception that the function was handling.
Stage.Cancel, Stage.Collect, Stage.Concat, Stage.Coupled, Stage.Distinct, Stage.DropWhile, Stage.Failed, Stage.Filter, Stage.FindFirst, Stage.FlatMap, Stage.FlatMapCompletionStage, Stage.FlatMapIterable, Stage.FromCompletionStage, Stage.FromCompletionStageNullable, Stage.Limit, Stage.Map, Stage.Of, Stage.OnComplete, Stage.OnError, Stage.OnErrorResume, Stage.OnErrorResumeWith, Stage.OnTerminate, Stage.Peek, Stage.ProcessorStage, Stage.PublisherStage, Stage.Skip, Stage.SubscriberStage, Stage.TakeWhile| Modifier and Type | Method and Description |
|---|---|
Function<Throwable,?> |
getFunction()
The error handler.
|
Copyright © 2018 – 2021 Eclipse Foundation. All rights reserved.
Use is subject to license terms.