code: def error_wrapper(fn, error_class):  # type: (Callable or None, Exception) -> ...
      
      def wrapper(*args, **kwargs):
          try:
              return fn(*args, **kwargs)
          except Exception as e:
              six.reraise(error_class, error_class(e), sys.exc_info()[2])
  
      return wrapper
docs: Wraps function fn in a try catch block that re-raises error_class.
  
      Args:
          fn (function): function to wrapped
          error_class (Exception): Error class to be re-raised
  
      Returns:
          (object): fn wrapped in a try catch.