Closed Viicos closed 2 years ago
To handle exceptions on open-objects, I need to get the correct status code when an exception is raised in the client class.
As the ClientError exception is raised from the requests.HTTPError, I'm still able to get the status code this way:
ClientError
requests.HTTPError
try: object = client.retrieve(...) except ClientError as err: print(err.__cause__.response.status_code)
But it would be great to have it accessible on the ClientError instead (or we could use the whole response as well, instead of just the status code).
To handle exceptions on open-objects, I need to get the correct status code when an exception is raised in the client class.
As the
ClientError
exception is raised from therequests.HTTPError
, I'm still able to get the status code this way:But it would be great to have it accessible on the ClientError instead (or we could use the whole response as well, instead of just the status code).