Skip to content

Commit

Permalink
fix: lambda execption
Browse files Browse the repository at this point in the history
  • Loading branch information
roleyfoley committed Jan 30, 2021
1 parent 82ce076 commit f47cc18
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions s3-inventory-copy/src/lambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ def s3batch_lambda_handler(event, context):
resultString = 'Retry request to Amazon S3 due to timeout.'
else:
resultCode = 'PermanentFailure'
resultString = '{}: {}'.format(errorCode, errorMessage)
resultString = f'{errorCode}: {errorMessage}'
except Exception as e:
# Catch all exceptions to permanently fail the task
resultCode = 'PermanentFailure'
resultString = 'Exception: {}'.format(e.message)
resultString = f'Exception: {e}'
finally:
results.append({
'taskId': taskId,
Expand Down Expand Up @@ -146,4 +146,4 @@ def rename_key(s3Key):
if os.environ.get('S3_DESTINATION_SUFFIX', None):
s3_key = s3_key + os.environ.get('S3_DESTINATION_SUFFIX')

return s3Key + '_new_suffix'
return s3_key

0 comments on commit f47cc18

Please sign in to comment.