Interface Stage.OnErrorResumeWith
-
- All Superinterfaces:
Stage
- Enclosing interface:
- Stage
public static interface Stage.OnErrorResumeWith extends Stage
A stage to handle errors from upstream. It builds a stream containing all the elements from upstream. Additionally, in the case of failure, rather than propagating the error downstream, it invokes the given function and switches control to the returned stream.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'sonError
method, it will instead relinquish control to thePublisherBuilder
returned from given function. In such a case, because no publisher necessarily invokesonError
, the subscriber may never know that an error happened.Any elements emitted by the returned publisher must be sent downstream, in addition to its completion and error signals. If the returned publisher completes with an error, that error must not result in the recovery function on this stage being invoked again.
Any
RuntimeException
thrown by the function must be propagated downstream as an error, replacing the exception that the function was handling.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.microprofile.reactive.streams.operators.spi.Stage
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
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.function.Function<java.lang.Throwable,Graph>
getFunction()
The error handler.
-
-
-
Method Detail
-
getFunction
java.util.function.Function<java.lang.Throwable,Graph> getFunction()
The error handler.- Returns:
- the error handler.
-
-