You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe your environment
AWS Lambda, python3.12, using opentelemetry-lambda layer-python 0.5 which includes opentelemetry-python 1.23.0 and opentelemetry-python-contrib 0.44b0
Steps to reproduce
A lambda function invoked with APIGW, with auto-instrumentation, after an unhandled exception causes:
[ERROR] UnboundLocalError: cannot access local variable 'result' where it is not associated with a value
Traceback (most recent call last):
File "/opt/python/wrapt/wrappers.py", line 598, in __call__
return self._self_wrapper(self.__wrapped__, self._self_instance,
File "/opt/python/opentelemetry/instrumentation/aws_lambda/__init__.py", line 378, in _instrumented_lambda_handler_call
if isinstance(result, dict) and result.get("statusCode"):
^^^^^^
What is the expected behavior?
The original exception is propagated (and not the UnboundLocalError)
What is the actual behavior?
The original exception is not propagated but this exception is raised instead:
[ERROR] UnboundLocalError: cannot access local variable 'result' where it is not associated with a value
Traceback (most recent call last):
File "/opt/python/wrapt/wrappers.py", line 598, in __call__
return self._self_wrapper(self.__wrapped__, self._self_instance,
File "/opt/python/opentelemetry/instrumentation/aws_lambda/__init__.py", line 378, in _instrumented_lambda_handler_call
if isinstance(result, dict) and result.get("statusCode"):
^^^^^^
Additional context
It seems that it would be enough to declare result at the beginning of this block of code:
Describe your environment
AWS Lambda, python3.12, using opentelemetry-lambda layer-python 0.5 which includes opentelemetry-python 1.23.0 and opentelemetry-python-contrib 0.44b0
Steps to reproduce
A lambda function invoked with APIGW, with auto-instrumentation, after an unhandled exception causes:
This can be reproduced with this code:
What is the expected behavior?
The original exception is propagated (and not the
UnboundLocalError
)What is the actual behavior?
The original exception is not propagated but this exception is raised instead:
Additional context
It seems that it would be enough to declare
result
at the beginning of this block of code:The text was updated successfully, but these errors were encountered: