(method)
return wrapper
Decorator to catch and print the exceptions that happen within async tasks.
    Note: this should be applied to methods of VSphereLegacyCheck only!
Decorator to catch and print the exceptions that happen within async tasks.
    Note: this should be applied to methods of VSphereLegacyCheck only!
Decorator to catch and print the exceptions that happen within async tasks . Note : this should be applied to methods of VSphereLegacyCheck only!
def trace_method(method):
    """
    Decorator to catch and print the exceptions that happen within async tasks.
    Note: this should be applied to methods of VSphereLegacyCheck only!
    """

    def wrapper(*args, **kwargs):
        try:
            method(*args, **kwargs)
        except Exception:
            args[0].print_exception("A worker thread crashed:\n" + traceback.format_exc())

    return wrapper
def trace_method ( method ) : def wrapper ( * args , * * kwargs ) : try : method ( * args , * * kwargs ) except Exception : args [ 0 ] . print_exception ( "A worker thread crashed:\n" + traceback . format_exc ( ) ) return wrapper