CompletableFuture.Exceptionally(IFunction) Method

Definition

Returns a new CompletableFuture that is completed when this CompletableFuture completes, with the result of the given function of the exception triggering this CompletableFuture's completion when it completes exceptionally; otherwise, if this CompletableFuture completes normally, then the returned CompletableFuture also completes normally with the same value.

[Android.Runtime.Register("exceptionally", "(Ljava/util/function/Function;)Ljava/util/concurrent/CompletableFuture;", "GetExceptionally_Ljava_util_function_Function_Handler", ApiSince=24)]
public virtual Java.Util.Concurrent.ICompletionStage? Exceptionally (Java.Util.Functions.IFunction? fn);
[<Android.Runtime.Register("exceptionally", "(Ljava/util/function/Function;)Ljava/util/concurrent/CompletableFuture;", "GetExceptionally_Ljava_util_function_Function_Handler", ApiSince=24)>]
abstract member Exceptionally : Java.Util.Functions.IFunction -> Java.Util.Concurrent.ICompletionStage
override this.Exceptionally : Java.Util.Functions.IFunction -> Java.Util.Concurrent.ICompletionStage

Parameters

fn
IFunction

the function to use to compute the value of the returned CompletableFuture if this CompletableFuture completed exceptionally

Returns

the new CompletableFuture

Implements

Attributes

Remarks

Java documentation for java.util.concurrent.CompletableFuture.exceptionally(java.util.function.Function<java.lang.Throwable, ? extends T>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to