code: def raise_on_errors(errors, level=logging.CRITICAL):
      
      if errors:
          log.log(level, "\n".join(errors))
          raise CoTError("\n".join(errors))
docs: Raise a CoTError if errors.
  
      Helper function because I had this code block everywhere.
  
      Args:
          errors (list): the error errors
          level (int, optional): the log level to use.  Defaults to logging.CRITICAL
  
      Raises:
          CoTError: if errors is non-empty