Skip to content

Commit

Permalink
change errorhandling at s3 download
Browse files Browse the repository at this point in the history
  • Loading branch information
SteKrause committed Apr 27, 2023
1 parent 9ad76d9 commit 0aee294
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions schulcloud/h5p/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0aee294

Please sign in to comment.