tensorstore.Promise.set_exception(self, exception: object) None

Marks the linked future as unsuccessfully completed with the specified error.

Example

>>> promise, future = ts.Promise.new()
>>> future.done()
False
>>> promise.set_exception(Exception(5))
>>> future.done()
True
>>> future.result()
Traceback (most recent call last):
    ...
Exception: 5