Browse files

Be more tolerant of non-xml error responses. Make sure roboto-based C…

…LI tools exit with status of 1 if an error is encountered.
  • Loading branch information...
1 parent 45d00c9 commit 9e339d319491faeeddb4fabe15372bdc55d1ecf0 @garnaat garnaat committed Jul 28, 2011
Showing with 6 additions and 1 deletion.
  1. +2 −1 boto/exception.py
  2. +4 −0 boto/roboto/awsqueryrequest.py
View
3 boto/exception.py
@@ -89,8 +89,9 @@ def __init__(self, status, reason, body=None, *args):
# Go ahead and clean up anything that may have
# managed to get into the error data so we
# don't get partial garbage.
- print "Warning: failed to parse error message from AWS: %s" % pe
self._cleanupParsedProperties()
+ self.error_message = self.body
+ self.status = ''
def __getattr__(self, name):
if name == 'message':
View
4 boto/roboto/awsqueryrequest.py
@@ -436,6 +436,10 @@ def do_cli(self):
sys.exit(1)
except self.ServiceClass.ResponseError, err:
print 'Error(%s): %s' % (err.error_code, err.error_message)
+ sys.exit(1)
+ except:
+ print 'Unexpected error. Use --debugger option for more info.'
+ sys.exit(1)
def _generic_cli_formatter(self, fmt, data, label=''):
if fmt['type'] == 'object':

0 comments on commit 9e339d3

Please sign in to comment.