diff options
author | Munyoki Kilyungi | 2022-11-28 17:12:09 +0300 |
---|---|---|
committer | Munyoki Kilyungi | 2022-11-28 17:13:57 +0300 |
commit | 361639fb97ce68b36cf9b4f134712bd3fa07dbce (patch) | |
tree | 1b63a98be35682d3c0a7610ebc37a04656ccada0 /gn3 | |
parent | d5bc1960a7846716a1dff3b025093639fd429cfc (diff) | |
download | genenetwork3-361639fb97ce68b36cf9b4f134712bd3fa07dbce.tar.gz |
Catch a URLError when virtuoso isn't running at all
* gn3/api/metadata.py: Import URLError.
(jsonify_dataset_metadata): Add URLError in except block.
Diffstat (limited to 'gn3')
-rw-r--r-- | gn3/api/metadata.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gn3/api/metadata.py b/gn3/api/metadata.py index 156af97..35e4067 100644 --- a/gn3/api/metadata.py +++ b/gn3/api/metadata.py @@ -1,5 +1,6 @@ """API for fetching metadata using an API""" from http.client import RemoteDisconnected +from urllib.error import URLError from flask import Blueprint from flask import jsonify from flask import current_app @@ -23,5 +24,5 @@ def jsonify_dataset_metadata(accession_id): ).data ) # The virtuoso server is misconfigured or it isn't running at all - except RemoteDisconnected: + except (RemoteDisconnected, URLError): return jsonify({}) |