@Override
    public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
      if (cause instanceof Exception) {
        exception = (Exception) cause;
        ctx.close();
      } else {
        ctx.fireExceptionCaught(cause);
      }
    }
Custom handler that receives the response.
ambry-test-utils/src/main/java/com/github/ambry/rest/NettyClient.java