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 26, 2023
1 parent 0859833 commit 477651e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions schulcloud/h5p/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,19 +458,18 @@ def download_object(self, object_key: str, dir_path: str, callback: Optional[Cal
def retry_function(self, function, max_retries: int):
retries = 0
while retries < max_retries:
print(f'>>>>try1 {function}')
try:
print(f'>>>>try {function}')
print(f'>>>>try2 {function}')
return function
except (ResponseStreamingError, ConnectionResetError, ProtocolError) as error:
# except (ResponseStreamingError, ConnectionResetError, ProtocolError) as error:
except Exception as error:
if retries == max_retries - 1:
print(f'>>>>>error')
raise error
else:
print(f'retry: {retries} for {function}')
retries = retries + 1
except Exception as error:
print(f'error2')
raise error


class MetadataNotFoundError(Exception):
Expand Down

0 comments on commit 477651e

Please sign in to comment.