final ReadHandler localHandler = handler;
if (localHandler != null) {
handler = null;
// call in the current thread, because otherwise handler executed
// in the different thread may deal with recycled Request/Response objects
localHandler.onError(
connection.isOpen()
? new CancellationException()
: new EOFException());
}
}