Skip to content

Commit acbeb41

Browse files
authored
Fallback to Message if message is missing from response (#872)
Works around dynamodb-local inconsistency of using 'message' key instead of 'Message' key.
1 parent ec56f95 commit acbeb41

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pynamodb/connection/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ def _make_api_call(self, operation_name, operation_kwargs):
421421
code = data.get('__type', '')
422422
if '#' in code:
423423
code = code.rsplit('#', 1)[1]
424-
botocore_expected_format = {'Error': {'Message': data.get('message', ''), 'Code': code}}
424+
botocore_expected_format = {'Error': {'Message': data.get('message', '') or data.get('Message', ''), 'Code': code}}
425425
verbose_properties = {
426426
'request_id': headers.get('x-amzn-RequestId')
427427
}

0 commit comments

Comments
 (0)