Skip to content

Commit e058017

Browse files
committed
Fix for AsyncHttpClient#69 [websocket] [netty] WebSocket#onError never called
1 parent 2834887 commit e058017

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/main/java/com/ning/http/client/providers/netty/NettyAsyncHttpProvider.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,11 +1507,12 @@ public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e)
15071507
log.error(t.getMessage(), t);
15081508
}
15091509
}
1510-
closeChannel(ctx);
1511-
ctx.sendUpstream(e);
15121510

15131511
Protocol p = (ctx.getPipeline().get(HttpClientCodec.class) != null ? httpProtocol : webSocketProtocol);
15141512
p.onError(ctx, e);
1513+
1514+
closeChannel(ctx);
1515+
ctx.sendUpstream(e);
15151516
}
15161517

15171518
protected static boolean abortOnConnectCloseException(Throwable cause) {
@@ -2125,8 +2126,8 @@ public Object call() throws Exception {
21252126
: new RequestBuilder(future.getRequest());
21262127

21272128
if (!(statusCode < 302 || statusCode > 303)
2128-
&& !(statusCode == 302
2129-
&& config.isStrict302Handling())) {
2129+
&& !(statusCode == 302
2130+
&& config.isStrict302Handling())) {
21302131
nBuilder.setMethod("GET");
21312132
}
21322133
final URI initialConnectionUri = future.getURI();
@@ -2337,7 +2338,7 @@ public void setContent(ChannelBuffer content) {
23372338
@Override
23382339
public void onError(ChannelHandlerContext ctx, ExceptionEvent e) {
23392340
try {
2340-
log.trace("onError {}", e);
2341+
log.warn("onError {}", e);
23412342
if (!NettyResponseFuture.class.isAssignableFrom(ctx.getAttachment().getClass())) {
23422343
return;
23432344
}

0 commit comments

Comments
 (0)