code: def wrapply(func, *args, **kwargs):
      'Like apply(), but which wraps Exceptions and passes through Wrappers (if first arg)'
      val = args[0]
      if val is None:
          return TypedWrapper(func, None)
      elif isinstance(val, TypedExceptionWrapper):
          tew = copy(val)
          tew.forwarded = True
          return tew
      elif isinstance(val, TypedWrapper):
          return val
      elif isinstance(val, Exception):
          return TypedWrapper(func, *args)
  
      try:
          return func(*args, **kwargs)
      except Exception as e:
          e.stacktrace = stacktrace()
          return TypedExceptionWrapper(func, *args, exception=ef wrapply(func, *args, **kwargs):
      'Like apply(), but which wraps Exceptions and passes through Wrappers (if first arg)'
      val = args[0]
      if val is None:
          return TypedWrapper(func, None)
      elif isinstance(val, TypedExceptionWrapper):
          tew = copy(val)
          tew.forwarded = True
          return tew
      elif isinstance(val, TypedWrapper):
          return val
      elif isinstance(val, Exception):
          return TypedWrapper(func, *args)
  
      try:
          return func(*args, **kwargs)
      except Exception as e:
          e.stacktrace = stacktrace()
          return TypedExceptionWrapper(func, *args, exception=e)
docs: Like apply(), but which wraps Exceptions and passes through Wrappers (if first arg)