Fix error handling in embedding worker: capture actual exception message

The except clause wasn't binding the exception to a variable, so
str(Exception) stored the class name "<class 'Exception'>" instead of
the actual error message. Now properly captures `as e` and stores str(e).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-22 10:34:11 -06:00
parent 07e22550fe
commit 771f714384

View File

@@ -119,14 +119,14 @@ async def run_worker():
try:
await _process_track(session, track)
logger.info("Embedded: %s - %s", track.artist, track.title)
except Exception:
except Exception as e:
logger.exception("Failed to embed %s - %s", track.artist, track.title)
await session.execute(
update(Track)
.where(Track.id == track.id)
.values(
embedding_status="failed",
embedding_error=str(Exception),
embedding_error=str(e),
)
)
await session.commit()