'Cancels the Future because of an error. Once cancelled, a
caller blocked on get_value will be able to continue.'

def cancel_with_error(self, exception):

    self._exception = exception
    self._event.set()
