Skip to content

Send mail errors should be handled#1670

Draft
CalamityC wants to merge 3 commits into
mainfrom
add-smtp-exception-handling
Draft

Send mail errors should be handled#1670
CalamityC wants to merge 3 commits into
mainfrom
add-smtp-exception-handling

Conversation

@CalamityC

Copy link
Copy Markdown
Collaborator

Related issue: #1668

Catch SMTP mail errors and surface validation messages

Comment thread rdmo/core/mail.py Outdated
from django.core.mail import EmailMessage


class MailSendError(Exception):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure if the want to make our custom Exception for this, but if we want it then there would be a special place in rdmo/core/exceptions.py (

class RDMOException(Exception):
). There is already a special exception that is actually never used throughout the code. 🫠

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Agreed that a custom exception belongs in rdmo/core/exceptions.py, not in core/mail.py.

I want a specific MailSendError so the view/API layers can handle SMTP failures distinctly, but it should inherit RDMOException and live in the shared exceptions module.

@coveralls

coveralls commented Jul 8, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 95.125% (+0.007%) from 95.118% — add-smtp-exception-handling into main

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.

3 participants