-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Log mailer errors in CE #4846
base: master
Are you sure you want to change the base?
Log mailer errors in CE #4846
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,16 @@ defmodule Plausible.Mailer do | |
end | ||
end | ||
|
||
defp handle_error(error) when is_exception(error) do | ||
# this message is ignored by Sentry, but it's useful in CE | ||
Logger.error("Failed to send e-mail:\n\n " <> Exception.format(:error, error), | ||
# Sentry report is built entirely from crash_reason | ||
crash_reason: {error, _stacktrace = []} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can add
Hm... there is no Context for the adapter used in EE (AFAIK): https://github.com/plausible/bamboo_postmark/blob/ed55d273dac6c9c121e86f04823acaa9be33114f/lib/bamboo/postmark_adapter.ex#L25-L40 -- it calls There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was #2361 verified to work at the time? It doesn't seem like |
||
) | ||
|
||
{:error, :unknown_error} | ||
end | ||
|
||
defp handle_error(error) do | ||
Logger.error("Failed to send e-mail", sentry: %{extra: %{response: error}}) | ||
{:error, :unknown_error} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mua errors are
Exception.t
s so they would be handled by this clause.