Skip to content

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
DamianLokic:T291934
Open

WIP: T291934: Skip Error Logging if the Zope Request will be retried (by Zope automatically)#9
DamianLokic wants to merge 3 commits intoperfact:masterfrom
DamianLokic:T291934

Conversation

@DamianLokic
Copy link
Copy Markdown

Skip Error Logging if the Zope Request will be retried (by Zope automatically)

@DamianLokic DamianLokic changed the title T291934: Skip Error Logging if the Zope Request will be retried (by Zope automatically) WIP: T291934: Skip Error Logging if the Zope Request will be retried (by Zope automatically) Jan 28, 2026
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:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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:
    return

And any particular reason why this was moved into the try block?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants