GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
The current master handles XML error responses well. It fills the BotoServerError object quite nicely. But when JSON is returned, the JSON is just dumped into self.error_message.
I created a function _parseJSONBody(self, body) that handles this JSON. It works, for example, when CloudFormation tells you that your template parameters are invalid. Now the returned BotoServerError is consistent with other cases.
Please apply to master.
Handle JSON-based BotoServerError body strings well
I would love to get this fixed. I'm concerned that this PR is making an assumption about the format of the JSON response that may not always be true. We should look across the services that do provide JSON errors and make sure the code is able to correctly pull the error code and error message out.
With body set to None, won't the repr (used in tracebacks) still be useless?
Why not set self.body to the error message.
Or maybe better yet, change repr to use error_message.
Good idea! I'll try to code this up in some spare time. That change is trivial, though, after pulling.