Skip to content
Snippets Groups Projects
Commit 476af90c authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Remove urllib dep. and make the exception more generic

parent 07856ea4
No related branches found
No related tags found
1 merge request!162Adds an explicit catch for cases where fetch_open_data fails
Pipeline #29257 failed
from __future__ import division
import os
import urllib2
import numpy as np
......@@ -343,7 +342,7 @@ def get_open_strain_data(
strain = TimeSeries.fetch_open_data(name, start_time, end_time, **kwargs)
logger.info('Saving cache of data to {}'.format(filename))
strain.write(filename)
except urllib2.URLError as e:
except Exception as e:
logger.info("Unable to fetch open data, see debug for detailed info")
logger.info("Call to gwpy.timeseries.TimeSeries.fetch_open_data returned {}"
.format(e))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment