From 58b9958bdf1263d052a1493f3ce9c8dd843784d9 Mon Sep 17 00:00:00 2001 From: Felix Henneke Date: Thu, 31 Oct 2024 16:54:41 +0100 Subject: [PATCH] silence errors even more --- src/helpers/database.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/helpers/database.py b/src/helpers/database.py index 69ef02a..00dcdcb 100644 --- a/src/helpers/database.py +++ b/src/helpers/database.py @@ -182,10 +182,13 @@ def write_prices_new(self, prices: list[tuple[str, int, float, str]]) -> None: "source": source, }, ) - except psycopg.errors.NumericValueOutOfRange: + except ( + psycopg.errors.NumericValueOutOfRange, + psycopg.errors.UniqueViolation, + ) as err: logger.info( - f"Error while writing price data. token: {token_address}, " - f"time: {time}, price: {price}, source: {source}" + f"Error while writing price data: {err}." + f"token: {token_address}, time: {time}, price: {price}, source: {source}" ) def get_latest_transaction(self) -> str | None: