From 61614622b7cd4375541e62c1551e981918f11fc1 Mon Sep 17 00:00:00 2001 From: cmyui Date: Mon, 1 Jul 2024 18:51:19 -0400 Subject: [PATCH] Better logs for s3 unexpected errors --- app/adapters/aws_s3.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/adapters/aws_s3.py b/app/adapters/aws_s3.py index d70afdb..bd1c70f 100644 --- a/app/adapters/aws_s3.py +++ b/app/adapters/aws_s3.py @@ -14,8 +14,8 @@ async def get_object_data(key: str) -> bytes | None: except state.s3_client.exceptions.NoSuchKey: return None except Exception: - logging.warning( - "Failed to get object data from S3", + logging.exception( + "Unexpected error when fetching object data from S3", exc_info=True, extra={"object_key": key}, ) @@ -42,10 +42,10 @@ async def save_object_data( **params, ) except Exception: - logging.warning( - "Failed to save object data to S3", + logging.exception( + "Unexpected error when saving object data from S3", exc_info=True, - extra={"object_key": key}, + extra={"object_key": key, "data_size": len(data)}, ) return None