From c4892a9fa5ce800bb4e94d1ff6128794cd3d9950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Fri, 20 Dec 2024 08:36:54 +0100 Subject: [PATCH] Add an additional error message on tiles in error --- .python-version | 1 + tilecloud_chain/store/postgresql.py | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 .python-version diff --git a/.python-version b/.python-version new file mode 100644 index 000000000..e4fba2183 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.12 diff --git a/tilecloud_chain/store/postgresql.py b/tilecloud_chain/store/postgresql.py index df37d5475..fa3908077 100644 --- a/tilecloud_chain/store/postgresql.py +++ b/tilecloud_chain/store/postgresql.py @@ -589,6 +589,8 @@ def delete_one(self, tile: Tile) -> Tile: """Delete the meta tile from the queue.""" with self.SessionMaker() as session: if tile.error: + if isinstance(tile.error, Exception): + _LOGGER.warning("Error while processing the tile %s", tile, exc_info=tile.error) sqlalchemy_tile = ( session.query(Queue) .where(and_(Queue.status == _STATUS_PENDING, Queue.id == tile.postgresql_id)) # type: ignore[attr-defined]