Skip to content

Commit

Permalink
Log mailer errors
Browse files Browse the repository at this point in the history
Signed-off-by: Andrés Vidal <[email protected]>
  • Loading branch information
andres-vidal committed Jun 3, 2024
1 parent d2879b7 commit ec020a0
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
defmodule RichardBurtonWeb.EmailController do
use Phoenix.Controller
require Logger
alias RichardBurton.Email

@spec contact(Plug.Conn.t(), any()) :: Plug.Conn.t()
Expand All @@ -11,7 +12,8 @@ defmodule RichardBurtonWeb.EmailController do
{:error, {:invalid, issues}} ->
conn |> put_status(400) |> json(%{issues: issues})

{:error, _} ->
{:error, reason} ->
reason |> IO.inspect() |> Logger.error()
conn |> put_status(500) |> json(%{message: "Could not send email."})
end
end
Expand Down

0 comments on commit ec020a0

Please sign in to comment.