Example usage for io.netty.handler.codec.http2 Http2Exception Http2Exception

List of usage examples for io.netty.handler.codec.http2 Http2Exception Http2Exception

Introduction

In this page you can find the example usage for io.netty.handler.codec.http2 Http2Exception Http2Exception.

Prototype

public Http2Exception(Http2Error error, String message) 

Source Link

Usage

From source file:io.grpc.netty.UtilsTest.java

License:Apache License

@Test
public void testStatusFromThrowable() {
    Status s = Status.CANCELLED.withDescription("msg");
    assertSame(s, Utils.statusFromThrowable(new Exception(s.asException())));
    Throwable t;/*  www.  j av  a2s .  c o m*/
    t = new ConnectTimeoutException("msg");
    assertStatusEquals(Status.UNAVAILABLE.withCause(t), Utils.statusFromThrowable(t));
    t = new Http2Exception(Http2Error.INTERNAL_ERROR, "msg");
    assertStatusEquals(Status.INTERNAL.withCause(t), Utils.statusFromThrowable(t));
    t = new Exception("msg");
    assertStatusEquals(Status.UNKNOWN.withCause(t), Utils.statusFromThrowable(t));
}