From 40e7d64482c30a5be4bcbf029601fbc1f2237976 Mon Sep 17 00:00:00 2001 From: Christophe Vandeplas Date: Tue, 30 Apr 2019 10:48:14 +0200 Subject: [PATCH] fix: [galaxies] UI msg internet is needed for galaxy download --- src/MISP_maltego/transforms/common/util.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/MISP_maltego/transforms/common/util.py b/src/MISP_maltego/transforms/common/util.py index 1317d86..ddaf1d2 100644 --- a/src/MISP_maltego/transforms/common/util.py +++ b/src/MISP_maltego/transforms/common/util.py @@ -431,10 +431,13 @@ def galaxy_update_local_copy(force=False): if force: # download the latest zip of the public galaxy - resp = requests.get(galaxy_archive_url) - zf = ZipFile(io.BytesIO(resp.content)) - zf.extractall(local_path_root) - zf.close() + try: + resp = requests.get(galaxy_archive_url) + zf = ZipFile(io.BytesIO(resp.content)) + zf.extractall(local_path_root) + zf.close() + except Exception: + raise(MaltegoException("ERROR: Could not download Galaxy data from htts://github.com/MISP/MISP-galaxy/. Please check internet connectivity.")) # generate the uuid mapping and save it to a file galaxies_fnames = []