Skip to content

Commit

Permalink
add more exception handle
Browse files Browse the repository at this point in the history
  • Loading branch information
quang-ng committed Nov 21, 2024
1 parent b7c2702 commit 1874d8b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions dsst_etl/upload_pdfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import boto3
import psycopg2
import sqlalchemy
from botocore.exceptions import ClientError

from dsst_etl import __version__
from dsst_etl._utils import get_bucket_name, get_compute_context_id
Expand Down Expand Up @@ -63,8 +62,7 @@ def upload_pdfs(self, pdf_paths: List[str]) -> Tuple[List[str], List[str]]:
self.s3_client.upload_file(pdf_path, self.bucket_name, s3_key)
successful_uploads.append(pdf_path)
logger.info(f"Successfully uploaded {pdf_path} to S3")

except ClientError as e:
except Exception as e:
logger.error(f"Failed to upload {pdf_path}: {str(e)}")
failed_uploads.append(pdf_path)

Expand Down

0 comments on commit 1874d8b

Please sign in to comment.