WIP: T291934: Skip Error Logging if the Zope Request will be retried (by Zope automatically)#9
Open
DamianLokic wants to merge 3 commits intoperfact:masterfrom
Open
WIP: T291934: Skip Error Logging if the Zope Request will be retried (by Zope automatically)#9DamianLokic wants to merge 3 commits intoperfact:masterfrom
DamianLokic wants to merge 3 commits intoperfact:masterfrom
Conversation
Wiseqube
reviewed
Feb 25, 2026
Products/PerFactErrors/errors.py
Outdated
| error_type, error_value, error_tb = event.exc_info | ||
| render = getattr(context, 'afterfail_error_message_', None) | ||
| retry = isinstance(error_value, TransientError) and req.supports_retry() | ||
| if render is None and not retry: |
There was a problem hiding this comment.
@DamianLokic Either one of these conditions should result in not doing anything, not both! Either we have no "render"-function or we are in a retry! This currently says something in the lines of "if we have no 'afterfail_error_message_' script implemented and we are not doing a retry, then we skip the logging" so more in the lines of
if render is None or retry:
returnAnd any particular reason why this was moved into the try block?
Author
There was a problem hiding this comment.
Hi, I will adjust the condition as described above.
The reason I moved this logic into the try block is that I need access to error_value from event.exc_info, which is already unpacked there.
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.
Skip Error Logging if the Zope Request will be retried (by Zope automatically)