public void sendException(Exception e) {
    SocketChannel channel = socket.getChannel();
    if (channel == null || !channel.isOpen()) {
      throw new IllegalStateException("cannot write to channel");
    }
    try {
      if (e instanceof ClientError) {
        channel.write(charsetASCII.encode(Reply.CLIENT_ERROR.toString()));
      } else {
        channel.write(charsetASCII.encode(Reply.ERROR.toString()));
      }
    } catch (IOException ignored) {
    }
  }
Returns an initialized byteBuffer for sending the reply

@param size size of ByteBuffer
@return the initialized response buffer
geode-memcached/src/main/java/org/apache/geode/internal/memcached/RequestReader.java