decorator that catches and returns an exception from wrapped function

def capture_exception(fn):
    """decorator that catches and returns an exception from wrapped function"""
    def wrapped(*args):
        try:
            return fn(*args)
        except Exception as e:
            return e
    return wrapped