private void deliver ( ) { try { deliverUnsafe ( ) ; } catch ( Throwable t ) { // This should never happen. If does, it means we are in an inconsistent state and should // close the stream and further processing should be prevented. This is accomplished by // purposefully leaving the lock non-zero and notifying the outerResponseObserver of the // error. Care must be taken to avoid calling close twice in case the first invocation threw // an error. innerController . cancel ( ) ; if ( ! finished ) { outerResponseObserver . onError ( t ) ; } } }
Tries to kick off the delivery loop wrapping it in error handling .