We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Along with the idea of uniform exceptions, we definitely expect errors to come back with JSON responses in, well, most all occasions in our own apis.
Bravado should be able to parse exception messages that are json. Otherwise taking any action on them is virtually impossible.
Here's an example from (swaggerpy):
(Pdb) e HTTPError(u'403 Client Error: Forbidden : {\n "error": {\n "code": "FLAGGING_FORBIDDEN", \n "description": "You can't flag this."\n }\n}',) (Pdb) e.message u'403 Client Error: Forbidden : {\n "error": {\n "code": "FLAGGING_FORBIDDEN", \n "description": "You can't flag this."\n }\n}' (Pdb) e.request (Pdb) e.response
Probably doesn't help that error request/response are empty. I can't even json.loads it myself because we stuff the status code in there. : (
The text was updated successfully, but these errors were encountered:
Fyi, going to cut a branch to fix this in swaggerpy (because it's a necessary requirement for me)
Sorry, something went wrong.
The same work to expose the the request/response on HTTPError needs to be done for bravado on the master branch.
No branches or pull requests
Along with the idea of uniform exceptions, we definitely expect errors to come back with JSON responses in, well, most all occasions in our own apis.
Bravado should be able to parse exception messages that are json. Otherwise taking any action on them is virtually impossible.
Here's an example from (swaggerpy):
(Pdb) e
HTTPError(u'403 Client Error: Forbidden : {\n "error": {\n "code": "FLAGGING_FORBIDDEN", \n "description": "You can't flag this."\n }\n}',)
(Pdb) e.message
u'403 Client Error: Forbidden : {\n "error": {\n "code": "FLAGGING_FORBIDDEN", \n "description": "You can't flag this."\n }\n}'
(Pdb) e.request
(Pdb) e.response
Probably doesn't help that error request/response are empty.
I can't even json.loads it myself because we stuff the status code in there. : (
The text was updated successfully, but these errors were encountered: