@Override
  public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
    throw exceptionToThrow;
  }
A {@link ChannelOutboundHandler} that throws exceptions on write.
ambry-rest/src/test/java/com/github/ambry/rest/NettyResponseChannelTest.java