@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { LOG.debug("Error ", cause); DefaultHttpResponse resp = ExceptionHandler.exceptionCaught(cause); resp.headers().set(CONNECTION, CLOSE); ctx.writeAndFlush(resp).addListener(ChannelFutureListener.CLOSE); }
final void rejectAsyncResults(@NotNull ExceptionHandler exceptionHandler) { if (!messageCallbackMap.isEmpty()) { Enumeration<AsyncPromise<Object>> elements = messageCallbackMap.elements(); while (elements.hasMoreElements()) { try { elements.nextElement().setError(REJECTED); } catch (Throwable e) { exceptionHandler.exceptionCaught(e); } } } }