Skip to content

Commit

Permalink
better error logging on error
Browse files Browse the repository at this point in the history
  • Loading branch information
extreme4all committed Jul 21, 2024
1 parent 39f929d commit 0a84833
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/bulk_normalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,17 +307,17 @@ async def insert_data_v3(batch: list[Message], error_queue: Queue):
)
await session.commit()
except (OperationalError, IntegrityError) as e:
logger.error({"error": e})
for message in batch:
await error_queue.put(message.model_dump())

logger.error({"error": e})
logger.info(f"error_qsize={error_queue.qsize()}, {message=}")
except Exception as e:
logger.error({"error": e})
logger.debug(f"Traceback: \n{traceback.format_exc()}")
for message in batch:
await error_queue.put(message.model_dump())

logger.error({"error": e})
logger.debug(f"Traceback: \n{traceback.format_exc()}")
logger.info(f"error_qsize={error_queue.qsize()}, {message=}")


Expand Down

0 comments on commit 0a84833

Please sign in to comment.