code: private void setLogicalCloseException(final Throwable t) {
  
        if(logicalCloseException == null) {
           logicalCloseException = t;
        } else if(!Util.isRuntimeError(logicalCloseException) && Util.isRuntimeError(t)) {
           logicalCloseException = t;
        }
     }
docs: Sets logicalCloseException if null or replaces logicalCloseException
  if not null && input is a runtime error.
  @param t The throwable