Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Registrar error cuando falla el proceso de renderizar email #179

Open
wants to merge 1 commit into
base: v5_backport
Choose a base branch
from

Conversation

MarcCalvoC
Copy link
Contributor

@MarcCalvoC MarcCalvoC commented Mar 4, 2025

Objetivos

Poder llevar un seguimiento de los emails que no se pueden renderizar para detectar plantillas incorrectas

@MarcCalvoC MarcCalvoC requested a review from eberloso March 4, 2025 14:39
@MarcCalvoC MarcCalvoC self-assigned this Mar 4, 2025
eberloso
eberloso previously approved these changes Mar 4, 2025
@MarcCalvoC MarcCalvoC force-pushed the log_error_when_email_rendering_fails branch from 50b2891 to 6fef33d Compare March 5, 2025 10:56
@ecarreras ecarreras requested a review from Copilot March 5, 2025 13:26
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

PR Overview

This PR introduces error logging when email template rendering fails, enabling better tracking of issues with incorrect templates.

  • Adds sentry_sdk import for error capture.
  • Captures and logs a warning message when an exception is raised during template rendering.

Reviewed Changes

File Description
poweremail_template.py Integrates Sentry logging into the exception handling block.

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

@@ -225,6 +226,8 @@ def get_value(cursor, user, recid, message=None, template=None, context=None):
reply = False
return reply or False
except Exception as e:
msg = (_('An error occurred while rendering template id {}: {}'.format(template.id, e.message)))
Copy link
Preview

Copilot AI Mar 5, 2025

Choose a reason for hiding this comment

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

Using 'e.message' may not reliably capture exception details in Python 3; consider using 'str(e)' instead to ensure full error information is logged.

Suggested change
msg = (_('An error occurred while rendering template id {}: {}'.format(template.id, e.message)))
msg = (_('An error occurred while rendering template id {}: {}'.format(template.id, str(e))))

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants