docs: def catch(cls, catch_exception, config='default'):
          """Decorator class method catching exceptions raised by the wrapped
          member function. When exception is caught, the decorator waits
          for an amount of time specified in the `ha_config`.
  
          :param catch_exception: Exception class or tuple of exception classes.
          """
          def wrap(method):
              @functools.wraps(method)
              def wrapped_method(self, *args, **kwargs):
                  assert isinstance(self, HA)
                  delay_policy = self.ha_get_delay_policy(config)
                  max_retries = self.ha_get_config(config).max_retries
                  for retries in itertools.count():
                      try:
                          return method(self, *args, **kwargs)
                      except catch_exception as e:
                          res = self.ha_on_error(method, e, args, kwargs)
                          if res is not None:
                              args, kwargs = res
                          if max_retries and retries >= max_retries:
                              raise
                          tts = next(delay_policy)
                          time.sleep(tts)
              return wrapped_method
          return wrap