code: def convert_error(exc_src, exc_dest):
      
  
      def wrap(func):
  
          @wraps(func)
          def wrapper(*args, **kwargs):
              try:
                  return func(*args, **kwargs)
              except exc_dest:
                  raise
              except exc_src as err:
                  reraise(exc_dest, err, sys.exc_info()[2])
  
          return wrapper
  
      return wrap
docs: A decorator for reraising exceptions with a different type.
      Mostly useful for IOError.
  
      Args:
          exc_src (type): The source exception type
          exc_dest (type): The target exception type.