Skip to content

[Question] Handling email backend exceptions #247

Answered by medmunds
1oglop1 asked this question in Q&A
Discussion options

You must be logged in to vote

The answer kind of depends on why you're catching the error and what you want to do with it—the specifics of the "do something useful" in your example.

If you're trying to do some generic handling—say, logging the error for later investigation—then catching the broad Exception seems fine. (It's what Django core contributor Tim Graham suggested in closing the Django ticket you found.)

For pretty much anything else, "do something useful" probably involves digging into the details of the error. And that's going to be specific to the email backend and even the particular ESP. For example, you might want to handle a temporary ESP outage by quietly queuing the email to re-send later. But if the…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@1oglop1
Comment options

Answer selected by 1oglop1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #246 on September 02, 2021 20:16.