Skip to content

Commit

Permalink
Fix class name logging
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Oct 12, 2023
1 parent d82aa95 commit bd3eb21
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/galaxy/jobs/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def setup_query(self):
(self.grab_model.states.NEW, self.grab_model.states.CANCELLING)
)
else:
raise NotImplementedError(f"Grabbing {self.grab_model} not implemented")
raise NotImplementedError(f"Grabbing {self.grab_model.__name__} not implemented")
subq = (
select(self.grab_model.id)
.where(
Expand Down Expand Up @@ -192,15 +192,19 @@ def grab_unhandled_items(self):
if self._supports_returning:
rows = proxy.fetchall()
if rows:
log.debug(f"Grabbed {type(self.grab_model)}(s): {', '.join(str(row[0]) for row in rows)}")
log.debug(
f"Grabbed {self.grab_model.__name__}(s): {', '.join(str(row[0]) for row in rows)}"
)
else:
trans.rollback()
except OperationalError as e:
# If this is a serialization failure on PostgreSQL, then e.orig is a psycopg2 TransactionRollbackError
# and should have attribute `code`. Other engines should just report the message and move on.
if int(getattr(e.orig, "pgcode", -1)) != 40001:
log.debug(
"Grabbing %s failed (serialization failures are ok): %s", self.grab_model, unicodify(e)
"Grabbing %s failed (serialization failures are ok): %s",
self.grab_model.__name__,
unicodify(e),
)
trans.rollback()

Expand Down

0 comments on commit bd3eb21

Please sign in to comment.