Need to sniff for 404 error codes
Bug #1379249 reported by
Stuart Bishop
This bug affects 3 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-swiftclient |
New
|
Wishlist
|
Unassigned |
Bug Description
A common pattern with python-swiftclient is:
try:
conn.
except ClientException as err:
if err.http_status != 404:
raise
[ ... handle not found ... ]
This is ugly and annoying from a developer's perspective. If a specific exception, inheriting from both swiftclient.
try:
conn.
except LookupError:
[ ... handle not found ... ]
Changed in python-swiftclient: | |
importance: | Undecided → Wishlist |
To post a comment you must log in.
The requests library (which is currently the gold standard for handling HTTP in Python) manages to provide both interfaces (exceptions or member variable inspection) successfully:
http:// docs.python- requests. org/en/ latest/ user/quickstart /#response- status- codes