Skip to content

Commit 787e034

Browse files
authored
[iris] Raise ConnectError(NOT_FOUND) from IrisClient.job_state (#5024)
Restore the pre-#5021 public API: Job.state / state_only() now surface ConnectError(Code.NOT_FOUND) when the job is missing, matching RemoteClusterClient._poll_job_state. The bare KeyError introduced by the lightweight polling path was a regression for callers that rely on ConnectError semantics. Follow-up to #5021.
1 parent 28f2170 commit 787e034

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/iris/src/iris/client/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ def job_state(self, job_id: JobName) -> job_pb2.JobState:
710710
states = self._cluster_client.get_job_states([job_id])
711711
wire_id = job_id.to_wire()
712712
if wire_id not in states:
713-
raise KeyError(f"Job {wire_id} not found")
713+
raise ConnectError(Code.NOT_FOUND, f"Job {wire_id} not found")
714714
return cast(job_pb2.JobState, states[wire_id])
715715

716716
def terminate(self, job_id: JobName) -> None:

0 commit comments

Comments
 (0)