code: @Override
    public void onClose(Status status, Metadata trailers) {
      if (status.getCause() instanceof StreamWaitTimeoutException) {
        StreamWaitTimeoutException timeoutException = (StreamWaitTimeoutException) status.getCause();
        switch(timeoutException.getState()) {
        case WAITING:
          operationSpan.addAnnotation("Received an WAITING timeout.");
          handleTimeoutError(status);
          return;
        case IDLE:
          operationSpan.addAnnotation("Received an IDLE timeout.");
          ((IdleResumingCallController) callWrapper).setIsIdle();
          return;
        default:
          // continue with onClose.
          break;
        }
      }
  
      super.onClose(status, trailers);
    }
docs: {@inheritDoc}