Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need method of recovery when a proxy error occurs downloading streamgage data #3

Open
pnorton-usgs opened this issue Jul 13, 2017 · 0 comments

Comments

@pnorton-usgs
Copy link
Collaborator

When a proxy error occurs while downloading streamgage data the program crashes (see output example below). Should add logic to attempt recovery when this happens and provide a better error message when the program must exit.

========
Generating stream network from tosegment_nhm
Extracting model subset
Parameter file written: /cxfs/projects/usgs/water/mows/NHM/bandit/jobs/20170620_GCPO/myparam.param
Processing CBH files
Downloading NWIS streamgage observations for 1235 stations
Streamgage: 08073500 (6/1235) ERROR: More than one Q-col returned
Streamgage: 08075000 (22/1235) Traceback (most recent call last):
File "../../Bandit/bandit.py", line 581, in
main()
File "../../Bandit/bandit.py", line 548, in main
streamflow.get_daily_streamgage_observations()
File "/cxfs/projects/usgs/water/mows/NHM/bandit/Bandit/prms_nwis.py", line 153, in get_daily_streamgage_observations
streamgage_obs_page = urlopen('{}/dv/{}'.format(BASE_NWIS_URL, url_final))
File "/home/pnorton/.conda/envs/bandit/lib/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/home/pnorton/.conda/envs/bandit/lib/python2.7/urllib2.py", line 435, in open
response = meth(req, response)
File "/home/pnorton/.conda/envs/bandit/lib/python2.7/urllib2.py", line 548, in http_response
'http', request, response, code, msg, hdrs)
File "/home/pnorton/.conda/envs/bandit/lib/python2.7/urllib2.py", line 467, in error
result = self._call_chain(*args)
File "/home/pnorton/.conda/envs/bandit/lib/python2.7/urllib2.py", line 407, in _call_chain
result = func(*args)
File "/home/pnorton/.conda/envs/bandit/lib/python2.7/urllib2.py", line 654, in http_error_302
return self.parent.open(new, timeout=req.timeout)
File "/home/pnorton/.conda/envs/bandit/lib/python2.7/urllib2.py", line 435, in open
response = meth(req, response)
File "/home/pnorton/.conda/envs/bandit/lib/python2.7/urllib2.py", line 548, in http_response
'http', request, response, code, msg, hdrs)
File "/home/pnorton/.conda/envs/bandit/lib/python2.7/urllib2.py", line 473, in error
return self._call_chain(*args)
File "/home/pnorton/.conda/envs/bandit/lib/python2.7/urllib2.py", line 407, in _call_chain
result = func(*args)
File "/home/pnorton/.conda/envs/bandit/lib/python2.7/urllib2.py", line 556, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 502: Proxy Error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant