code: def error(self, error_msg):
          
          if self.logger is not None:
              self.logger.error(error_msg)
  
          if self.exc is not None:
              raise self.exc(error_msg)
docs: Outputs error message on own logger. Also raises exceptions if need be.
  
          Args:
              error_msg: message to output