ntt / eveapi

Python library for accessing the EVE Online API
Other
148 stars 57 forks source link

HTTP error codes #17

Closed jonasblomqvist closed 5 years ago

jonasblomqvist commented 11 years ago

I just noticed that Odyssey 1.0.1 started using http error codes instead of xml errorcodes to describe problems (patchnotes here) eveapi.py will just crash if a api-key is expired... (http 403 error)

jonasblomqvist commented 11 years ago

a quick & dirty patch seems to be to add if response.status httplib.FORBIDDEN or response.status httplib.UNAUTHORIZED: raise AuthenticationError(response.status, str(response.status)+" - "+response.reason) at around line 379

the complete check would be something like: if response.status != 200: if response.status httplib.NOT_FOUND: raise AttributeError("'%s' not available on API server (404 Not Found)" % path) if response.status httplib.FORBIDDEN or response.status == httplib.UNAUTHORIZED: raise AuthenticationError(response.status, str(response.status)+" - "+response.reason) else: raise RuntimeError("'%s' request failed (%d %s)" % (path, response.status, response.reason))

not sure if that breaks anything else :D

notnullxyz commented 5 years ago

This is still open, and I was wondering if it could be closed? Being a 2013 issue, is is still a problem ?

ntt commented 5 years ago

This is still open, and I was wondering if it could be closed? Being a 2013 issue, is is still a problem ?

You do realise the XML API no longer exists right?