Search in sources :

Example 1 with OriginConnectException

use of com.netflix.zuul.netty.connectionpool.OriginConnectException in project zuul by Netflix.

the class OriginResponseReceiver method channelInactive.

@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
    if (edgeProxy != null) {
        LOG.debug("Origin channel inactive. channel-info={}", ChannelUtils.channelInfoForLogging(ctx.channel()));
        OriginConnectException ex = new OriginConnectException("Origin server inactive", RESET_CONNECTION);
        edgeProxy.errorFromOrigin(ex);
    }
    super.channelInactive(ctx);
    ctx.close();
}
Also used : OriginConnectException(com.netflix.zuul.netty.connectionpool.OriginConnectException)

Example 2 with OriginConnectException

use of com.netflix.zuul.netty.connectionpool.OriginConnectException 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

OriginConnectException (com.netflix.zuul.netty.connectionpool.OriginConnectException)2 OutboundException (com.netflix.zuul.exception.OutboundException)1 ReadTimeoutException (io.netty.handler.timeout.ReadTimeoutException)1 SSLHandshakeException (javax.net.ssl.SSLHandshakeException)1