예제 #1
0
 @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);
 }
예제 #2
0
 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);
       }
     }
   }
 }