Skip to content

Commit c9aa8c0

Browse files
Get error message by converting exception to string (#222)
`exc["errorMessage"]` fails because exc is not a dict.
1 parent 4e2a03c commit c9aa8c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

data-collection/deploy/module-backup.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ Resources:
228228
try:
229229
count = store_to_s3(flatten_data_iterator, s3_prefix)
230230
except backup.exceptions.ClientError as exc:
231-
if 'Insufficient privileges to perform this action.' in exc["errorMessage"]:
231+
if 'Insufficient privileges to perform this action.' in str(exc):
232232
raise Exception(
233233
'You need to activate cross account jobs monitoring '
234234
'https://docs.aws.amazon.com/aws-backup/latest/devguide/manage-cross-account.html#enable-cross-account'

0 commit comments

Comments
 (0)