From 2a285cb84e4ec92b6d9e697ed1f7576fe2b3c44f Mon Sep 17 00:00:00 2001 From: Helen Bailey Date: Wed, 8 Jun 2022 12:23:10 -0400 Subject: [PATCH] Update error messages Why these changes are being introduced: A couple of the error messages are slightly confusing in the notification emails because we can't easily filter or format the text before sending. How this addresses that need: * Makes minor updates to a couple error messages for clarity. * Also updates .gitignore to ignore vscode workspace files. --- .gitignore | 1 + ppod.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index b08301d..3f5cbdc 100644 --- a/.gitignore +++ b/.gitignore @@ -152,3 +152,4 @@ cython_debug/ #.idea/ .DS_Store +.vscode \ No newline at end of file diff --git a/ppod.py b/ppod.py index 3b4c93a..9f55d73 100644 --- a/ppod.py +++ b/ppod.py @@ -51,7 +51,7 @@ def lambda_handler(event: dict, context: object) -> dict: ) file_count += 1 else: - raise ValueError(f"No files extracted from {s3_file}") + raise ValueError(f"No files extracted from tarfile: {s3_file}") return {"files_processed": file_count} @@ -100,7 +100,9 @@ def filter_files_in_bucket(bucket: str, prefix: str) -> Generator[str, None, Non ): yield s3_object["Key"] except KeyError: - raise KeyError(f"No files retrieved from {bucket} with prefix {prefix}") + raise KeyError( + f"No files retrieved from bucket '{bucket}' with prefix '{prefix}'" + ) def post_file_to_pod(