If I decorate a function that is called as a BatchInvoke [1] with @client.capture_exceptions, raven will bomb out as it expects the event parameter to be a single item in a dict, when in fact event gets a list of dict's when the lambda is called with BatchInvoke.
Traceback (most recent call last):
File "/var/task/aws_xray_sdk/core/recorder.py", line 359, in wrapper
meta_processor=None,
File "/var/task/aws_xray_sdk/core/recorder.py", line 374, in record_subsegment
return_value = wrapped(*args, **kwargs)
File "/var/task/handler.py", line 60, in graphql_handler
return batch_handler(event, context)
File "/var/task/raven/contrib/awslambda/__init__.py", line 125, in wrapped
self.captureException(event=event, context=context, **kwargs)
File "/var/task/raven/base.py", line 824, in captureException
'raven.events.Exception', exc_info=exc_info, **kwargs)
File "/var/task/raven/contrib/awslambda/__init__.py", line 69, in capture
http_info = self._get_http_interface(event)
File "/var/task/raven/contrib/awslambda/__init__.py", line 147, in _get_http_interface
if event.get('path') and event.get('httpMethod'):
AttributeError: 'list' object has no attribute 'get'
If I decorate a function that is called as a BatchInvoke [1] with
@client.capture_exceptions
, raven will bomb out as it expects theevent
parameter to be a single item in a dict, when in factevent
gets a list of dict's when the lambda is called with BatchInvoke.[1] https://docs.aws.amazon.com/appsync/latest/devguide/tutorial-lambda-resolvers.html#advanced-use-case-batching