def raise_exceptions(func):
    caller = gevent.getcurrent()

    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        try:
            return func(*args, **kwargs)
        except Exception as ex:
            caller.throw(ex)

    return wrapper
Wrap around for spawn to raise exceptions in current context
dataset/ETHPy150Open facebook/pyaib/pyaib/util/decorator.py/raise_exceptions