@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { if (cause instanceof DecoderException) { DecoderException err = (DecoderException) cause; cause = err.getCause(); } upgradeFuture.tryFail(cause); }
private synchronized void handleException(Throwable t) { if (t instanceof DecoderException) { DecoderException err = (DecoderException) t; t = err.getCause(); } handleClose(t); }
@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { if (cause instanceof DecoderException) { DecoderException err = (DecoderException) cause; cause = err.getCause(); } upgradeFuture.tryFail(cause); }
private synchronized void handleException(Throwable t) { if (t instanceof DecoderException) { DecoderException err = (DecoderException) t; t = err.getCause(); } handleClose(t); }
void upgradeToSSLConnection(Handler<AsyncResult<Void>> completionHandler) { ChannelPipeline pipeline = socket.channelHandlerContext().pipeline(); Future<Void> upgradeFuture = Future.future(); upgradeFuture.setHandler(ar->{ if (ar.succeeded()) { completionHandler.handle(Future.succeededFuture()); } else { Throwable cause = ar.cause(); if (cause instanceof DecoderException) { DecoderException err = (DecoderException) cause; cause = err.getCause(); } completionHandler.handle(Future.failedFuture(cause)); } }); pipeline.addBefore("handler", "initiate-ssl-handler", new InitiateSslHandler(this, upgradeFuture)); }
void upgradeToSSLConnection(Handler<AsyncResult<Void>> completionHandler) { ChannelPipeline pipeline = socket.channelHandlerContext().pipeline(); Future<Void> upgradeFuture = Future.future(); upgradeFuture.setHandler(ar->{ if (ar.succeeded()) { completionHandler.handle(Future.succeededFuture()); } else { Throwable cause = ar.cause(); if (cause instanceof DecoderException) { DecoderException err = (DecoderException) cause; cause = err.getCause(); } completionHandler.handle(Future.failedFuture(cause)); } }); pipeline.addBefore("handler", "initiate-ssl-handler", new InitiateSslHandler(this, upgradeFuture)); }
assertTrue(e.getCause() instanceof SSLHandshakeException);