From 9b78ccb47426fdc8d3346ae6d0babec60a0596aa Mon Sep 17 00:00:00 2001 From: David McKee Date: Tue, 7 Feb 2023 15:49:25 +0000 Subject: [PATCH] Invert error check --- ds-caselaw-ingester/lambda_function.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ds-caselaw-ingester/lambda_function.py b/ds-caselaw-ingester/lambda_function.py index 84c681a..41b054c 100644 --- a/ds-caselaw-ingester/lambda_function.py +++ b/ds-caselaw-ingester/lambda_function.py @@ -324,8 +324,8 @@ def handler(event, context): try: s3_response = http.request("GET", message["s3-folder-url"]) tar_gz_contents = s3_response.data - if s3_response.status < 400: - raise S3HTTPError(tar_gz_contents) + if s3_response.status >= 400: + raise S3HTTPError(tar_gz_contents[:250]) except Exception: # Send retry message to sqs if the GET fails send_retry_message(message, sqs_client)