@classmethod<EOL><INDENT>def catch(cls, catch_exception, config='<STR_LIT:default>'):<DEDENT>
def wrap(method):<EOL><INDENT>@functools.wraps(method)<EOL>def wrapped_method(self, *args, **kwargs):<EOL><INDENT>assert isinstance(self, HA)<EOL>delay_policy = self.ha_get_delay_policy(config)<EOL>max_retries = self.ha_get_config(config).max_retries<EOL>for retries in itertools.count():<EOL><INDENT>try:<EOL><INDENT>return method(self, *args, **kwargs)<EOL><DEDENT>except catch_exception as e:<EOL><INDENT>res = self.ha_on_error(method, e, args, kwargs)<EOL>if res is not None:<EOL><INDENT>args, kwargs = res<EOL><DEDENT>if max_retries and retries >= max_retries:<EOL><INDENT>raise<EOL><DEDENT>tts = next(delay_policy)<EOL>time.sleep(tts)<EOL><DEDENT><DEDENT><DEDENT>return wrapped_method<EOL><DEDENT>return wrap<EOL>
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.