From 5a18c9143544829c0ddf7d8563d8c42b1b2671e8 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Tue, 21 Apr 2009 09:21:13 +0000 Subject: [PATCH] Fixed a problem where HttpTunnelingChannelHandler does not log caught exceptions --- .../channel/socket/http/HttpTunnelingChannelHandler.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/org/jboss/netty/channel/socket/http/HttpTunnelingChannelHandler.java b/src/main/java/org/jboss/netty/channel/socket/http/HttpTunnelingChannelHandler.java index 473e1c6be8..f6b8d03112 100644 --- a/src/main/java/org/jboss/netty/channel/socket/http/HttpTunnelingChannelHandler.java +++ b/src/main/java/org/jboss/netty/channel/socket/http/HttpTunnelingChannelHandler.java @@ -40,6 +40,8 @@ import org.jboss.netty.channel.ChannelStateEvent; import org.jboss.netty.channel.ExceptionEvent; import org.jboss.netty.channel.MessageEvent; import org.jboss.netty.channel.SimpleChannelUpstreamHandler; +import org.jboss.netty.logging.InternalLogger; +import org.jboss.netty.logging.InternalLoggerFactory; /** * A channel handler that proxies messages to the servlet output stream @@ -50,6 +52,9 @@ import org.jboss.netty.channel.SimpleChannelUpstreamHandler; */ @ChannelPipelineCoverage("one") class HttpTunnelingChannelHandler extends SimpleChannelUpstreamHandler { + + private static final InternalLogger logger = InternalLoggerFactory.getInstance(HttpTunnelingChannelHandler.class); + List awaitingEvents = new ArrayList(); private final Lock reconnectLock = new ReentrantLock(); @@ -129,6 +134,7 @@ class HttpTunnelingChannelHandler extends SimpleChannelUpstreamHandler { @Override public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception { + logger.warn("Unexpected exception", e.getCause()); if (invalidated.compareAndSet(false, true)) { session.invalidate(); }