qrisp.interface.Job._raise_for_status#

Job._raise_for_status(status: JobStatus | None = None) None[source]#

Raise the appropriate exception if the job did not complete successfully.

Concrete implementations should call this inside result() after the job has reached a terminal state (i.e. after any blocking wait).

Parameters:
statusJobStatus or None, optional

The terminal JobStatus that was already determined by the caller’s wait mechanism. When provided, this value is used directly and no additional status() call is made: which avoids a redundant network round-trip on remote backends. If omitted (or None), status() is called to obtain the current state.

Raises:
JobFailureError

If status is ERROR.

JobCancelledError

If status is CANCELLED.