-
Notifications
You must be signed in to change notification settings - Fork 21
Description
Right now it is unclear exactly what each non 200 status code means precisely for each potential client method. For instance, if I try to find a key in a non existent key/value store will that give me a different response than if the key is missing in a existing key/value store? I see two (not necessarily mutually exclusive) options to make this more clear.
-
Documentation Fix:
For each method (or set of methods if they share status codes exactly), document the precise meanings of all non-200 status codes (including 204). This will allow anyone to then use "raise for status" properly and handle the codes after. Also, as a side note, it seems that raise_for_status should be not_raise_for_status, since the arguments are what are allowed. -
Custom Exceptions Feature:
For all scenarios like ContainerNotFound, KeyValueTableNotFound, or KeyValueKeyNotFound allow the dataplane client to specify an optional argument - something like raise_exceptions: bool - to allow users to choose if they want status codes or for a meaningful exception to be raised. Then users can consult that documentation and use a try catch block around client calls. I personally favor this from a python library as opposed to status codes which can be hard to interpret and contextual.