Remove not necessary try / catch block. See #587
This commit is contained in:
parent
2a56ab59c7
commit
bd557a6330
@ -60,22 +60,18 @@ class WebSocketServerHandshakeHandler extends ChannelInboundMessageHandlerAdapte
|
|||||||
if (handshaker == null) {
|
if (handshaker == null) {
|
||||||
wsFactory.sendUnsupportedWebSocketVersionResponse(ctx.channel());
|
wsFactory.sendUnsupportedWebSocketVersionResponse(ctx.channel());
|
||||||
} else {
|
} else {
|
||||||
try {
|
final ChannelFuture handshakeFuture = handshaker.handshake(ctx.channel(), req);
|
||||||
final ChannelFuture handshakeFuture = handshaker.handshake(ctx.channel(), req);
|
handshakeFuture.addListener(new ChannelFutureListener() {
|
||||||
handshakeFuture.addListener(new ChannelFutureListener() {
|
@Override
|
||||||
@Override
|
public void operationComplete(ChannelFuture future) throws Exception {
|
||||||
public void operationComplete(ChannelFuture future) throws Exception {
|
if (!future.isSuccess()) {
|
||||||
if (!future.isSuccess()) {
|
ctx.fireExceptionCaught(future.cause());
|
||||||
ctx.fireExceptionCaught(future.cause());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
WebSocketServerProtocolHandler.setHandshaker(ctx, handshaker);
|
});
|
||||||
ctx.pipeline().replace(this, "WS403Responder",
|
WebSocketServerProtocolHandler.setHandshaker(ctx, handshaker);
|
||||||
WebSocketServerProtocolHandler.forbiddenHttpRequestResponder());
|
ctx.pipeline().replace(this, "WS403Responder",
|
||||||
} catch (WebSocketHandshakeException e) {
|
WebSocketServerProtocolHandler.forbiddenHttpRequestResponder());
|
||||||
ctx.fireExceptionCaught(e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user