Search in sources :

Example 1 with NoTransitionStreamError

use of com.webpieces.http2engine.impl.shared.data.NoTransitionStreamError in project webpieces by deanhiller.

the class Level5AStates method translateException.

private CompletableFuture<Void> translateException(Stream stream, Throwable t) {
    CompletableFuture<Void> fut = new CompletableFuture<>();
    if (t instanceof NoTransitionConnectionError)
        fut.completeExceptionally(new ConnectionException(CancelReasonCode.BAD_FRAME_RECEIVED_FOR_THIS_STATE, logId, stream.getStreamId(), t.getMessage(), t));
    else if (t instanceof NoTransitionStreamError)
        fut.completeExceptionally(new StreamException(CancelReasonCode.CLOSED_STREAM, logId, stream.getStreamId(), t.getMessage(), t));
    else
        fut.completeExceptionally(t);
    return fut;
}
Also used : CompletableFuture(java.util.concurrent.CompletableFuture) NoTransitionStreamError(com.webpieces.http2engine.impl.shared.data.NoTransitionStreamError) NoTransitionConnectionError(com.webpieces.http2engine.impl.shared.data.NoTransitionConnectionError) ConnectionException(com.webpieces.http2parser.api.dto.error.ConnectionException) StreamException(com.webpieces.http2parser.api.dto.error.StreamException)

Aggregations

NoTransitionConnectionError (com.webpieces.http2engine.impl.shared.data.NoTransitionConnectionError)1 NoTransitionStreamError (com.webpieces.http2engine.impl.shared.data.NoTransitionStreamError)1 ConnectionException (com.webpieces.http2parser.api.dto.error.ConnectionException)1 StreamException (com.webpieces.http2parser.api.dto.error.StreamException)1 CompletableFuture (java.util.concurrent.CompletableFuture)1