code: 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
docs: Decorator to catch and print the exceptions that happen within async tasks.
      Note: this should be applied to methods of VSphereCheck only!