kapadia / usgs

Client library for interfacing with USGS datasets
http://kapadia.github.io/usgs/
ISC License
109 stars 38 forks source link

KeyError on wrong credentials #54

Closed sbrunato closed 3 years ago

sbrunato commented 3 years ago

Hi, using 0.3.0, if you try to login using wrong credentials, the api raises a KeyError when trying to get the auth error message:

>>> from usgs import USGSError, api
>>> api.login("foo","bar")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/sylvain/workspace/usgs/usgs/api.py", line 129, in login
    raise USGSError(response["error"])
KeyError: 'error'