New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fragile reporting for poorly implemented exceptions #2683
Labels
bug
Something isn't working
Comments
Hello, please assign this issue to me, thank you |
#main...kennykguo:opentelemetry-python:patch-1 |
8 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe your environment
Python 3.9, Cornice 3.6, Pyramid 10.7
Steps to reproduce
Attempt to validate a request using an invalid json payload.
A more testable reproduction is raising an exception with a broken implementation of
__str__
.What is the expected behavior?
The failure to parse the exception for its attributes results in a new uncaught exception.
What is the actual behavior?
Cornice creates a
_JSONError
exception (based onHttpException
viaHttpError
) which manages to avoid setting thedetail
attribute. Sincedetail
is assumed to exist for the implementation of Pyramid'sHttpException.__str__()
an AttributeError exception is thrown at https://github.com/open-telemetry/opentelemetry-python/blob/main/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py#L944.Additional context
It seems gathering attributes should have a guard around it in the event the exception type has an unresolvable
__str__
implementation. Maybe getting the stack usingtraceback.format_exc()
could supplement the provided exception?The text was updated successfully, but these errors were encountered: