code: def handle_executor_exceptions(func):
      """
      Decorator for handling errors that come from an Executor. This decorator should
      only be used on functions where executor errors are possible. I.e. the function
      uses StorageExecutor.
      """
  
      def inner_function(*args, **kwargs):
          try:
              return func(*args, **kwargs)
          except BrokenStorageExecutorError:
              # This is fatal. So we bail ASAP.
              # We also don't want to log, because KeyboardInterrupt on worker processes
              # also take us here, so it's going to be "normal" user operation most of the
              # time.
              # BrokenExecutor parents both BrokenThreadPool and BrokenProcessPool.
              sys.exit(1)
  
      return inner_function
  
file_path: metaflow/metaflow/plugins/storage_executor.py
imports: import math
  import multiprocessing
  import os
  import platform
  import sys
  from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor
  from metaflow.exception import MetaflowException
label_desc: Use image node_id 4 for calling a global function with example usage: handle_executor_exceptions(func) and returns: inner_function, func