Skip to content

Commit

Permalink
Better logs for s3 unexpected errors
Browse files Browse the repository at this point in the history
  • Loading branch information
cmyui committed Jul 1, 2024
1 parent 54adedf commit 6161462
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/adapters/aws_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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},
)
Expand All @@ -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

Expand Down

0 comments on commit 6161462

Please sign in to comment.