Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Be more tolerant of non-xml error responses. Make sure roboto-based C…
Browse files Browse the repository at this point in the history
…LI tools exit with status of 1 if an error is encountered.
  • Loading branch information
garnaat committed Jul 28, 2011
1 parent 5f466ef commit c91ad5a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion boto/exception.py
Expand Up @@ -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':
Expand Down
4 changes: 4 additions & 0 deletions boto/roboto/awsqueryrequest.py
Expand Up @@ -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':
Expand Down

0 comments on commit c91ad5a

Please sign in to comment.