Example usage for java.util.concurrent CompletionException getCause

List of usage examples for java.util.concurrent CompletionException getCause

Introduction

In this page you can find the example usage for java.util.concurrent CompletionException getCause.

Prototype

public synchronized Throwable getCause() 

Source Link

Document

Returns the cause of this throwable or null if the cause is nonexistent or unknown.

Usage

From source file:org.trellisldp.http.impl.BaseTestHandler.java

protected void unwrapAsyncError(final CompletionStage async) {
    try {/*w  w w .ja  v a2 s.  c  o m*/
        async.toCompletableFuture().join();
    } catch (final CompletionException ex) {
        if (ex.getCause() instanceof WebApplicationException) {
            throw (WebApplicationException) ex.getCause();
        }
        throw ex;
    }
}