Skip to content

Commit

Permalink
refactor: swap assert with raise in DAQJobRemote
Browse files Browse the repository at this point in the history
  • Loading branch information
furkan-bilgin committed Oct 19, 2024
1 parent a6c5dad commit cfede93
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/daq/jobs/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ def _unpack_message(self, message: bytes) -> DAQJobMessage:
message_class = self._message_class_cache[message_type]

res = message_class.from_json(data)
assert res.id is not None, "Message id is not set"
if res.id is None:
raise Exception("Message id is not set")

self._remote_message_ids.add(res.id)
if len(self._remote_message_ids) > DAQ_JOB_REMOTE_MAX_REMOTE_MESSAGE_ID_COUNT:
self._remote_message_ids.pop()
Expand Down

0 comments on commit cfede93

Please sign in to comment.