mirror of
https://github.com/cosmo-sims/cosmICweb-music.git
synced 2024-09-19 16:53:43 +02:00
better error logging
This commit is contained in:
parent
dd477197a4
commit
24028afc06
1 changed files with 6 additions and 3 deletions
|
@ -91,6 +91,7 @@ def fetch_ellipsoids(url, api_token, attempts):
|
|||
r.raise_for_status()
|
||||
except requests.exceptions.HTTPError as e:
|
||||
logging.warning("Failed fetching (attempt {}/{}) ...".format(i, attempts))
|
||||
logging.warning(e)
|
||||
else:
|
||||
content = r.json()
|
||||
return [
|
||||
|
@ -121,8 +122,9 @@ def fetch_downloadstore(cosmicweb_url, target):
|
|||
# This will raise an error if not successful
|
||||
r.raise_for_status()
|
||||
except requests.exceptions.HTTPError as e:
|
||||
logging.critical("Failed downloading from cosmICweb.")
|
||||
sys.exit("Error")
|
||||
logging.critical(f"Failed downloading from cosmICweb.")
|
||||
logging.critical(e)
|
||||
sys.exit(1)
|
||||
content = r.json()
|
||||
sim = content["simulation"]
|
||||
halo_urls = [
|
||||
|
@ -150,7 +152,8 @@ def fetch_publication(cosmicweb_url, publication_name, traceback_radius):
|
|||
r.raise_for_status()
|
||||
except requests.exceptions.HTTPError as e:
|
||||
logging.critical("Failed downloading from cosmICweb.")
|
||||
sys.exit("Error")
|
||||
logging.critical(e)
|
||||
sys.exit(1)
|
||||
content = r.json()
|
||||
sim = content["simulation"]
|
||||
halo_names = [h["name"] for h in content["halos"]]
|
||||
|
|
Loading…
Reference in a new issue