From 477651e25fab46f27775c79e2ca6c69796419967 Mon Sep 17 00:00:00 2001 From: stekrause Date: Wed, 26 Apr 2023 16:25:28 +0200 Subject: [PATCH] change errorhandling at s3 download --- schulcloud/h5p/upload.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/schulcloud/h5p/upload.py b/schulcloud/h5p/upload.py index 81a19a46..1640ab91 100644 --- a/schulcloud/h5p/upload.py +++ b/schulcloud/h5p/upload.py @@ -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):