-
Notifications
You must be signed in to change notification settings - Fork 143
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
Handling condition where Entity.cause is not a dict. #267
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix!
Codecov Report
@@ Coverage Diff @@
## master #267 +/- ##
===========================================
- Coverage 79.37% 44.42% -34.96%
===========================================
Files 82 82
Lines 3248 3253 +5
===========================================
- Hits 2578 1445 -1133
- Misses 670 1808 +1138
Continue to review full report at Codecov.
|
* Handling condition where cause is not a dict. Exceptions should be appended not replaced. * Adding more test cases * Minor fixes to some tests * Some type checking in python2 may require to import unicode literals * Checking python version for type comparison
Issue #154
Description of changes:
In a case of exception chaining where an unhandled exception is captured in a subsegment and then propagated to the parent segment/subsegment, the
cause
property of this parent entity becomes astr
fromdict
to record the exception id from the child subsegment. Any further dictionary operation thiscause
will result in TypeError.Doing a type check on the Entity.cause when adding a new exception and resetting the cause to dict since we cannot recover the original cause dict once it has been updated to a string.
Also, making sure when adding multiple exceptions to an entity, they should be appended and not replaced.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.