Clear State before raising errors - #34
Merged
Merged
Conversation
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) Signed-off-by: Elijah Swift <elijah.swift@ibm.com>
lcarcaramo
reviewed
Nov 3, 2023
Signed-off-by: Elijah Swift <elijah.swift@ibm.com>
added comment to describe need for extract call in new test. Signed-off-by: Elijah Swift <elijah.swift@ibm.com>
lcarcaramo
reviewed
Nov 3, 2023
ElijahSwiftIBM
force-pushed
the
cleanup_after_segment_errors
branch
from
November 3, 2023 14:28
0e6c510 to
4504025
Compare
Signed-off-by: Elijah Swift <elijah.swift@ibm.com>
ElijahSwiftIBM
force-pushed
the
cleanup_after_segment_errors
branch
from
November 3, 2023 14:32
4504025 to
eca4e7c
Compare
lcarcaramo
approved these changes
Nov 3, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.