ntt / eveapi

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

Requests returning errors are not cached #3

Closed dinoboff closed 12 years ago

dinoboff commented 13 years ago

Currently, if the server reports an error, an Error exception is raise and the response id not cached: https://github.com/ntt/eveapi/blob/master/eveapi.py#L197

I see no reason to not cache most request having a 1xx or 2xx error code; The same request will get the same response.

eveapi should check the error code and cache it if appropriate before raising the Error exception.

ntt commented 12 years ago

The only problem with that is that errors can cover all of the api system, just that method, or the specific parameters of it, and there is no way of knowing what the scope of an error is, and thus there is no good way of knowing at what level to cache the errors. The design doesn't lend itself for that very well either. If you have a solution I'd be happy to hear it :)