public void failed(Throwable t) {
        Queue<Entry> queue;
        synchronized (lock) {
            if ((queue = this.queue) == null) {
                throw new IllegalStateException();
            }
            this.queue = null;
            lock.notifyAll();
        }
        for (Entry entry : queue) {
            entry.handler.failed(t);
        }
    }
<p>This method calls {@link CompletionHandler#failed(Throwable)} on all pending {@link CompletionHandler}s, and
blocks all future operations to this ContentChannel (i.e. calls to {@link #write(ByteBuffer, CompletionHandler)}
and {@link #close(CompletionHandler)} throw IllegalStateExceptions).</p>

<p>This method will also notify any thread waiting in {@link #read()}.</p>

@param t The Throwable to pass to all pending CompletionHandlers.
@throws IllegalStateException If this method is called more than once.
jdisc_core/src/main/java/com/yahoo/jdisc/handler/ReadableContentChannel.java