def create_failure(exception=None):
    if exception:
        return FailedFuture(type(exception), exception, None)
    return FailedFuture(*sys.exc_info())
This returns an object implementing IFailedFuture.
dataset/ETHPy150Open crossbario/txaio/txaio/aio.py/create_failure