kapadia/usgs

KeyError on wrong credentials

sbrunato opened this issue · 0 comments

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'