WattTime / pyiso

Python client libraries for ISO and other power grid data sources.
http://pyiso.readthedocs.org/
Other
237 stars 110 forks source link

Catch error when PJM load has no response #77

Closed aschn closed 8 years ago

aschn commented 8 years ago

args {"market": "RT5M", "latest": true} at 2016-06-13 18:41:00.194257+00:00

 File "/app/.heroku/python/lib/python2.7/site-packages/pyiso/tasks.py", line 30, in get_load
    data = c.get_load(**kwargs)
  File "/app/.heroku/python/lib/python2.7/site-packages/pyiso/pjm.py", line 184, in get_load
    load_ts, load_val = self.fetch_edata_point('InstantaneousLoad', 'PJM RTO Total', 'MW')
  File "/app/.heroku/python/lib/python2.7/site-packages/pyiso/pjm.py", line 56, in fetch_edata_point
    response = self.request(url)
  File "/app/.heroku/python/lib/python2.7/site-packages/pyiso/pjm.py", line 97, in request
    if response.status_code == 400:
AttributeError: 'NoneType' object has no attribute 'status_code'