Closed alertedsnake closed 1 year ago
Oh - noticed one other case where it's impossible to check the result status - Model.list and Model.find don't return the result object at all, so there's no way for a program using this library to capture these errors.
Edited: spoke too soon - nearly all of the classes based on Model
throw away the HTTP result object, so this would have to be done in connection.py
.
Closing this issue now we've published v1.0.0 https://pypi.org/project/fastly/
In
connection.py
there are only a few HTTP error codes checked for:400,401,403,404,500
but we often see several other responses, especiallyHTTP 502
. The logic to do this checking is a little flawed, it assumes any response not caught specifically is an OK response, requiring clients to do extensive checking on each call for the extra error cases.This logic should be rewritten to either raise specific errors for all possible cases, or to raise a default error when the status code is not
2xx
.