Skip to content

Commit

Permalink
catch exceptions while getting ticket from tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
Kunsi committed Feb 16, 2025
1 parent 6e2690a commit f2d73af
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions voctopublish/voctopublish.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,22 +639,25 @@ class PublisherException(Exception):


def process_single_ticket():
w = Worker()
w.get_ticket_from_tracker()
try:
w = Worker()
w.get_ticket_from_tracker()

if w.ticket:
try:
if w.ticket:
if w.worker_type == "releasing":
w.publish()
elif w.worker_type == "recording":
w.download()
else:
raise PublisherException(f"unknown worker type {w.worker_type}")
return True
except Exception as e:
except Exception as e:
if w.ticket:
exc_type, exc_obj, exc_tb = sys.exc_info()
w.c3tt.set_ticket_failed(w.ticket_id, f"{exc_type.__name__}: {e}")
logging.exception(f"could not process ticket {w.ticket_id}")
else:
raise e
return False


Expand Down

0 comments on commit f2d73af

Please sign in to comment.