Skip to content

Commit

Permalink
Fallback to Message if message is missing from response (#872)
Browse files Browse the repository at this point in the history
Works around dynamodb-local inconsistency of using 'message' key instead of 'Message' key.
  • Loading branch information
samhandev committed Nov 2, 2020
1 parent ec56f95 commit acbeb41
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pynamodb/connection/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ def _make_api_call(self, operation_name, operation_kwargs):
code = data.get('__type', '')
if '#' in code:
code = code.rsplit('#', 1)[1]
botocore_expected_format = {'Error': {'Message': data.get('message', ''), 'Code': code}}
botocore_expected_format = {'Error': {'Message': data.get('message', '') or data.get('Message', ''), 'Code': code}}
verbose_properties = {
'request_id': headers.get('x-amzn-RequestId')
}
Expand Down

0 comments on commit acbeb41

Please sign in to comment.