flawless/client/decorators.py
def wrap_class(cls, error_threshold=None):
    ''' Wraps a class with reporting to errors backend by decorating each function of the class.
            Decorators are injected under the classmethod decorator if they exist.
    '''
    methods = inspect.getmembers(cls, inspect.ismethod) + inspect.getmembers(cls, inspect.isfunction)
    for method_name, method in methods:
        wrapped_method = flawless.client.client._wrap_function_with_error_decorator(
            method if not im_self(method) else im_func(method),
            save_current_stack_trace=False,
            error_threshold=error_threshold,
        )
        if im_self(method):
            wrapped_method = classmethod(wrapped_method)
        setattr(cls, method_name, wrapped_method)
    return cls
def wrap_class(cls, error_threshold=None):
    ''' Wraps a class with reporting to errors backend by decorating each function of the class.
            Decorators are injected under the classmethod decorator if they exist.
    '''
    methods = inspect.getmembers(cls, inspect.ismethod) + inspect.getmembers(cls, inspect.isfunction)
    for method_name, method in methods:
        wrapped_method = flawless.client.client._wrap_function_with_error_decorator(
            method if not im_self(method) else im_func(method),
            save_current_stack_trace=False,
            error_threshold=error_threshold,
        )
        if im_self(method):
            wrapped_method = classmethod(wrapped_method)
        setattr(cls, method_name, wrapped_method)
    return cls
Wraps a class with reporting to errors backend by decorating each function of the class.
            Decorators are injected under the classmethod decorator if they exist.