Mark the future done and set an exception. If the future is already done when this method is called, raises InvalidStateError.
asyncio/Future.set_exception
Future.set_exception