code: def log_error(self, msg):
          
          if self.__logger:
              self.__logger.error(msg)
  
          raise RuntimeError(msg)
docs: Log an error and raise an exception.
  
          Args:
              msg: Error message to log.
  
          Raises:
              RuntimeError: With the message.