Skip to content

Commit

Permalink
TaskQueueReader: Added exception handler.
Browse files Browse the repository at this point in the history
Increases robustness in case user callback fails to handle their exception.
  • Loading branch information
xsedla1o committed Sep 19, 2023
1 parent 153d8db commit 824dc5a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dp3/task_processing/task_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,10 @@ def _msg_processing_thread_func(self):
continue

# Pass message to user's callback function
self.callback(tag, task)
try:
self.callback(tag, task)
except Exception as e:
self.log.exception("Error in user callback function. %s: %s", type(e), str(e))

def _stop_consuming_thread(self) -> None:
if self._consuming_thread:
Expand Down

0 comments on commit 824dc5a

Please sign in to comment.