@Override
 public void exceptionCaught(ChannelHandlerContext remoteChannelCtx, Throwable cause)
     throws Exception {
   logger.error(
       cause.getMessage() + uaChannel.attr(ApnProxyConnectionAttribute.ATTRIBUTE_KEY), cause);
   remoteChannelCtx.close();
 }
 @Override
 public void exceptionCaught(ChannelHandlerContext context, Throwable cause) {
   LOG.error(cause.getMessage(), cause);
   if (context.channel().isOpen()) {
     context.channel().close();
   }
 }
 @Override
 public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
   cause.printStackTrace();
   Channel ch = ctx.channel();
   if (ch.isActive()) {
     ch.writeAndFlush(Unpooled.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE);
   }
 }
 @Override
 public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
   if (!isIgnorableException(cause)) {
     cause.printStackTrace();
     if (ctx.channel().isActive()) {
       sendError(ctx, HttpResponseStatus.INTERNAL_SERVER_ERROR);
     }
   }
 }
示例#5
0
    @Override
    public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
      if (cause instanceof ReadTimeoutException) {
        LOG.warn(cause.getMessage(), cause);
      } else {
        LOG.error("Fetch failed :", cause);
      }

      // this fetching will be retry
      IOUtils.cleanup(LOG, fc, raf);
      finishTime = System.currentTimeMillis();
      state = TajoProtos.FetcherState.FETCH_FAILED;
      ctx.close();
    }
示例#6
0
 private void handleDeath(Throwable cause) {
   if (cause != null)
     sendHttpResponse(
         ctx,
         req,
         new DefaultFullHttpResponse(
             req.getProtocolVersion(),
             INTERNAL_SERVER_ERROR,
             Unpooled.wrappedBuffer(
                 ("Actor is dead because of " + cause.getMessage()).getBytes())),
         false);
   else
     sendHttpResponse(
         ctx,
         req,
         new DefaultFullHttpResponse(
             req.getProtocolVersion(),
             INTERNAL_SERVER_ERROR,
             Unpooled.wrappedBuffer(("Actor has terminated.").getBytes())),
         false);
 }
 private boolean isIgnorableException(Throwable throwable) {
   // There really does not seem to be a better way of detecting this kind of exception
   return throwable instanceof IOException
       && throwable.getMessage().equals("Connection reset by peer");
 }
 @Override
 public void exceptionCaught(@NotNull ChannelHandlerContext ctx, @NotNull Throwable cause) {
   // Close the connection when an exception is raised.
   cause.printStackTrace();
   ctx.close();
 }
示例#9
0
 @Override
 public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
   cause.printStackTrace();
   ctx.close();
 }