Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Gracefully handle download failures #3

Open
funnelfiasco opened this issue Mar 11, 2013 · 0 comments
Open

Gracefully handle download failures #3

funnelfiasco opened this issue Mar 11, 2013 · 0 comments

Comments

@funnelfiasco
Copy link

The profile.py code that downloads a sounding does not gracefully handle download failures (for example a 404 because you're requesting a station that does not have soundings):

[1027 bcotton@sheldon ~/devel/SHARPpy ]$ python run_sharppy.py ind
http://www.spc.noaa.gov/exper/soundings/LATEST/IND.txt
Traceback (most recent call last):
File "run_sharppy.py", line 343, in
profs = [profile.Profile(url=url)]
File "/home/bcotton/devel/SHARPpy/sharppy/sharptab/profile.py", line 22, in init
for i in range(bgn, end+1):
UnboundLocalError: local variable 'bgn' referenced before assignment
[1028 bcotton@sheldon ~/devel/SHARPpy ]$

The code should probably check the getcode() method to ensure the HTTP request returned 200. If I can motivate myself to learn a bit of python, I'll submit a patch.

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

No branches or pull requests

1 participant