Repository navigation
Fix duplicated error message in ODataV4Format.__str__ - #49499
Draft
Ryan McGee (rjmcgee53192) wants to merge 1 commit into
Draft
Ryan McGee (rjmcgee53192) wants to merge 1 commit into
Ryan McGee (rjmcgee53192) wants to merge 1 commit into
Conversation
Contributor
|
Thank you for your contribution Ryan McGee (@rjmcgee53192)! We will review the pull request and get back to you soon. |
|
Azure Pipelines: Successfully started running 3 pipeline(s). 5 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Author
|
@microsoft-github-policy-service agree |
This branch has not been deployed
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.
Fixes #41937.
Problem
ODataV4Format.__str__rendered the error message twice:__str__builds"({}) {}\n{}"fromcode,message, andmessage_details(), butmessage_details()also included aMessage: ...line. SinceHttpResponseErrorstoresstr(self.error)as its message, the duplication propagated intoHttpResponseError.messagetoo (and gets noisy fast with long messages, e.g. policy errors).Change
Removed the redundant
Message: ...line frommessage_details()— the message is already the leading part of__str__'s header. Output is now:All information is retained; nothing else in azure-core calls
message_details().Files changed
sdk/core/azure-core/azure/core/exceptions.py— 1-line removal inODataV4Format.message_details()sdk/core/azure-core/tests/test_exceptions.py— new regression testtest_odata_v4_str_does_not_duplicate_message; updated one assertion intest_deserialized_httpresponse_error_codethat encoded the old duplicated outputsdk/core/azure-core/CHANGELOG.md— entry under 1.42.0 (Unreleased) / Bugs FixedTest evidence
str()); after the fix it counts 1x.tests/test_exceptions.pysuite: 28 passed (includes the new regression test).