Skip to content

Commit

Permalink
Improve error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
dragon-dxw committed Nov 1, 2023
1 parent ebe5d79 commit ad75982
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ds-caselaw-ingester/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def extract_docx_filename(metadata: dict, consignment_reference: str) -> str:
return metadata["parameters"]["TRE"]["payload"]["filename"]
except KeyError:
raise DocxFilenameNotFoundException(
f"No .docx filename was found in metadata. Consignment Ref: {consignment_reference}"
f"No .docx filename was found in metadata. Consignment Ref: {consignment_reference}, metadata: {metadata}"
)


Expand Down Expand Up @@ -349,7 +349,9 @@ def copy_file(tarfile, input_filename, output_filename, uri, s3_client: Session.
file = tarfile.extractfile(input_filename)
store_file(file, uri, output_filename, s3_client)
except KeyError:
raise FileNotFoundException(f"File was not found: {input_filename}")
raise FileNotFoundException(
f"File was not found: {input_filename}, files were {tarfile.getnames()} "
)


def send_retry_message(
Expand Down

0 comments on commit ad75982

Please sign in to comment.