Skip to content

Commit 59a2ece

Browse files
committed
fix: re-arrange FallbackController calls to avoid warning
1 parent 21305b4 commit 59a2ece

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/realtime_web/controllers/fallback_controller.ex

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,6 @@ defmodule RealtimeWeb.FallbackController do
2929
|> render("error.json", changeset: changeset)
3030
end
3131

32-
def call(conn, {:error, _}) do
33-
conn
34-
|> put_status(:unauthorized)
35-
|> put_view(RealtimeWeb.ErrorView)
36-
|> render("error.json", message: "Unauthorized")
37-
end
38-
3932
def call(conn, {:error, status, message}) when is_atom(status) and is_binary(message) do
4033
log_error("UnprocessableEntity", message)
4134

@@ -57,6 +50,13 @@ defmodule RealtimeWeb.FallbackController do
5750
|> render("error.json", changeset: changeset)
5851
end
5952

53+
def call(conn, {:error, _}) do
54+
conn
55+
|> put_status(:unauthorized)
56+
|> put_view(RealtimeWeb.ErrorView)
57+
|> render("error.json", message: "Unauthorized")
58+
end
59+
6060
def call(conn, %Ecto.Changeset{valid?: false} = changeset) do
6161
log_error(
6262
"UnprocessableEntity",

0 commit comments

Comments
 (0)