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:
@@ -119,14 +119,14 @@ async def run_worker():
|
|||||||
try:
|
try:
|
||||||
await _process_track(session, track)
|
await _process_track(session, track)
|
||||||
logger.info("Embedded: %s - %s", track.artist, track.title)
|
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)
|
logger.exception("Failed to embed %s - %s", track.artist, track.title)
|
||||||
await session.execute(
|
await session.execute(
|
||||||
update(Track)
|
update(Track)
|
||||||
.where(Track.id == track.id)
|
.where(Track.id == track.id)
|
||||||
.values(
|
.values(
|
||||||
embedding_status="failed",
|
embedding_status="failed",
|
||||||
embedding_error=str(Exception),
|
embedding_error=str(e),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
await session.commit()
|
await session.commit()
|
||||||
|
|||||||
Reference in New Issue
Block a user