mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
fix(portal): catch all errors when sending welcome email (#9776)
Why: * We were previously only catching the `:rate_limited` error when sending welcome emails. This update adds a catch-all case to gracefully handle the error and alert us. --------- Signed-off-by: Brian Manifold <bmanifold@users.noreply.github.com> Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
This commit is contained in:
@@ -4,6 +4,7 @@ defmodule Web.Actors.Show do
|
||||
import Web.Clients.Components
|
||||
alias Domain.{Auth, Tokens, Flows, Clients}
|
||||
alias Domain.Actors
|
||||
require Logger
|
||||
|
||||
def mount(%{"id" => id}, _session, socket) do
|
||||
with {:ok, actor} <-
|
||||
@@ -730,6 +731,23 @@ defmodule Web.Actors.Show do
|
||||
)
|
||||
|
||||
{:noreply, socket}
|
||||
|
||||
{:error, reason} ->
|
||||
Logger.error("Unknown error while sending welcome email",
|
||||
account_id: socket.assigns.account.id,
|
||||
subject_actor_id: socket.assigns.subject.actor.id,
|
||||
identity_id: identity.id,
|
||||
reason: inspect(reason)
|
||||
)
|
||||
|
||||
socket =
|
||||
socket
|
||||
|> put_flash(
|
||||
:error,
|
||||
"Unknown error while sending welcome email. We're looking into it."
|
||||
)
|
||||
|
||||
{:noreply, socket}
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user