From 0aee2949c8e8261f9cf8a41533a8e9a9ea7b4113 Mon Sep 17 00:00:00 2001 From: stekrause Date: Thu, 27 Apr 2023 10:26:16 +0200 Subject: [PATCH] change errorhandling at s3 download --- schulcloud/h5p/upload.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/schulcloud/h5p/upload.py b/schulcloud/h5p/upload.py index d199bec1..54cc52ea 100644 --- a/schulcloud/h5p/upload.py +++ b/schulcloud/h5p/upload.py @@ -434,16 +434,12 @@ def download_object(self, object_key: str, dir_path: str, callback: Optional[Cal file_path = os.path.join(dir_path, object_key) if not os.path.exists(os.path.dirname(file_path)): os.makedirs(os.path.dirname(file_path)) - try: - self.client.download_file( - Bucket=self.bucket_name, - Key=object_key, - Filename=file_path, - Callback=callback - ) - except Exception as error: - print(f'Got Error: ') - raise error + self.client.download_file( + Bucket=self.bucket_name, + Key=object_key, + Filename=file_path, + Callback=callback + ) def retry_function(self, function, max_retries: int): retries = 0