Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add state clearing before raising SegmentError or SegmentTraitError.
Add unit test for this (Unit test for SegmentTraitError includes extract to simulate functionality of add when generateRequestOnly is not set)
💡 Issue Reference
Issue: #33
💻 What does this address?
SegmentError and SegmentTraitError exit the code without clearing segment trait dictionaries. This leads to improper request dictionaries built on the next request.
📟 Implementation Details
added call to clear_state() function before throwing errors.
📋 Is there a test case?
Built new test cases, one for SegmentError and one for SegmentTraitError, both hanging off of USER Admin
Test cases work as designed. Without clear_state() both fail, with it they succeed.