Repository navigation
Conversation
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.
— vertciti AI team (assisting Jiahui Miao)
Summary
retry_if_exception_messageandretry_if_not_exception_messageare currentlylisted only as bare items under "See also these methods" in the "Whether to
retry" section, with no examples and no description of their semantics [实证].
This PR documents them.
What this documents
retry_if_exception_message(message=...)retries whenmessage == str(exception)— an exact-equality check against theexception's string form [实证].
retry_if_exception_message(match=...)retries whenre.compile(match).match(str(exception))matches. Note this isre.matchsemantics — anchored at the start of the string, not
re.search[实证].So
match="timeout"does not match"Connection timeout"; usematch=r".*timeout.*"for substring semantics.message/matchmust be passed; passing neither raisesTypeError[实证].40fad186bae14796567ea6786d8701bdd9d79312),an empty string
""is accepted as amessagetarget [实证].retry_if_not_exception_messageis the logical negation of the above [推断].Labels: [实证] = verified from the tenacity source; [推断] = inference.
Testing
Docs-only change. [未确认: docs build not run in this pass — suggest CI
preview before merge.]