Search in sources :

Example 6 with ReadTimeoutException

use of io.netty.handler.timeout.ReadTimeoutException in project zuul by Netflix.

the class RequestAttempt method setException.

public void setException(Throwable t) {
    if (t != null) {
        if (t instanceof ReadTimeoutException) {
            error = "READ_TIMEOUT";
            exceptionType = t.getClass().getSimpleName();
        } else if (t instanceof OriginConnectException) {
            OriginConnectException oce = (OriginConnectException) t;
            if (oce.getErrorType() != null) {
                error = oce.getErrorType().toString();
            } else {
                error = "ORIGIN_CONNECT_ERROR";
            }
            final Throwable cause = t.getCause();
            if (cause != null) {
                exceptionType = t.getCause().getClass().getSimpleName();
            } else {
                exceptionType = t.getClass().getSimpleName();
            }
        } else if (t instanceof OutboundException) {
            OutboundException obe = (OutboundException) t;
            error = obe.getOutboundErrorType().toString();
            exceptionType = OutboundException.class.getSimpleName();
        } else if (t instanceof SSLHandshakeException) {
            error = t.getMessage();
            exceptionType = t.getClass().getSimpleName();
            cause = t.getCause().getMessage();
        } else {
            error = t.getMessage();
            exceptionType = t.getClass().getSimpleName();
            cause = Throwables.getStackTraceAsString(t);
        }
    }
}
Also used : ReadTimeoutException(io.netty.handler.timeout.ReadTimeoutException) OriginConnectException(com.netflix.zuul.netty.connectionpool.OriginConnectException) SSLHandshakeException(javax.net.ssl.SSLHandshakeException) OutboundException(com.netflix.zuul.exception.OutboundException)

Aggregations

ReadTimeoutException (io.netty.handler.timeout.ReadTimeoutException)6 Test (org.junit.Test)3 CountDownLatch (java.util.concurrent.CountDownLatch)2 AtomicIntegerArray (java.util.concurrent.atomic.AtomicIntegerArray)2 AtomicReference (java.util.concurrent.atomic.AtomicReference)2 OutboundException (com.netflix.zuul.exception.OutboundException)1 ZuulException (com.netflix.zuul.exception.ZuulException)1 OriginConnectException (com.netflix.zuul.netty.connectionpool.OriginConnectException)1 DefaultFullHttpResponse (io.netty.handler.codec.http.DefaultFullHttpResponse)1 DefaultHttpResponse (io.netty.handler.codec.http.DefaultHttpResponse)1 HttpResponse (io.netty.handler.codec.http.HttpResponse)1 IOException (java.io.IOException)1 Properties (java.util.Properties)1 SSLHandshakeException (javax.net.ssl.SSLHandshakeException)1 FullJitterBackoff (org.apache.flink.streaming.connectors.kinesis.proxy.FullJitterBackoff)1 FakeKinesisFanOutBehavioursFactory (org.apache.flink.streaming.connectors.kinesis.testutils.FakeKinesisFanOutBehavioursFactory)1 SubscriptionErrorKinesisV2 (org.apache.flink.streaming.connectors.kinesis.testutils.FakeKinesisFanOutBehavioursFactory.SubscriptionErrorKinesisV2)1 TestConsumer (org.apache.flink.streaming.connectors.kinesis.testutils.TestUtils.TestConsumer)1