dropbox / pynsot

A Python client and CLI utility for the Network Source of Truth (NSoT) REST API.
https://pynsot.readthedocs.io
Other
46 stars 25 forks source link

Improve exception erroring #82

Open coxley opened 8 years ago

coxley commented 8 years ago

This is what an exception for an attribute not existing when creating network looks like:

pynsot.vendor.slumber.exceptions.HttpClientError: Client Error 400: https://nsot.example.com/api/sites/4/networks/

That tells me nothing. You can catch the exception and inspect .response.json(), but this should be part of our client lib. We should create our own exception types.

jathanism commented 8 years ago

Just to mirror what I've shared before... If you look at pynsot.app.App, I want more of the user-friendliness to actually just be integrated into the default client, including the error-handling and helper methods.

jathanism commented 8 years ago

Translation: All exceptions (400 <=> 500 error codes) should be caught, and their payloads returned...