Skip to content

Commit 1f0f605

Browse files
author
Tom McCarthy
committed
chore: use kwargs in method calls, add comment to SQSBatchProcessingError
1 parent 12f1cbe commit 1f0f605

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

aws_lambda_powertools/utilities/batch/exceptions.py

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ def __init__(self, msg="", child_exceptions=()):
1212
self.msg = msg
1313
self.child_exceptions = child_exceptions
1414

15+
# Overriding this method so we can output all child exception tracebacks when we raise this exception to prevent
16+
# errors being lost. See https://github.com/awslabs/aws-lambda-powertools-python/issues/275
1517
def __str__(self):
1618
parent_exception_str = super(SQSBatchProcessingError, self).__str__()
1719
exception_list = [f"{parent_exception_str}\n"]

aws_lambda_powertools/utilities/batch/sqs.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ def _process_record(self, record) -> Tuple:
9191
An object to be processed.
9292
"""
9393
try:
94-
result = self.handler(record)
95-
return self.success_handler(record, result)
94+
result = self.handler(record=record)
95+
return self.success_handler(record=record, result=result)
9696
except Exception:
97-
return self.failure_handler(record, sys.exc_info())
97+
return self.failure_handler(record=record, exception=sys.exc_info())
9898

9999
def _prepare(self):
100100
"""

0 commit comments

Comments
 (0)