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

Gracefully handle download failures #3

Description

@funnelfiasco

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions