From c8db11af78602eb00dd86c4d79779efd80269439 Mon Sep 17 00:00:00 2001 From: cccs-rs <62077998+cccs-rs@users.noreply.github.com> Date: Fri, 24 Sep 2021 11:53:17 +0000 Subject: [PATCH] pass on SkipSource exception --- assemblyline_v4_service/updater/helper.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/assemblyline_v4_service/updater/helper.py b/assemblyline_v4_service/updater/helper.py index 4c1e12c8..feccb28d 100644 --- a/assemblyline_v4_service/updater/helper.py +++ b/assemblyline_v4_service/updater/helper.py @@ -122,14 +122,13 @@ def url_download(source: Dict[str, Any], previous_update: int = None, else: return [(file_path, get_sha256_for_file(file_path))] - except requests.Timeout: - # TODO: should we retry? - pass + except SkipSource: + # Raise to calling function for handling + raise except Exception as e: # Catch all other types of exceptions such as ConnectionError, ProxyError, etc. - logger.info(str(e)) + logger.warning(str(e)) exit() - # TODO: Should we exit even if one file fails to download? Or should we continue downloading other files? finally: # Close the requests session session.close()