5647e5642a
Build, Lint, and Test / Build, Lint, and Test (push) Failing after 1m21s
- Remove unused aliases that caused warnings-as-errors in EX_CHECK mode - Run mix format to fix formatter check - Add root-level yarn install to CI for prettier (used by mix check) - All 1007 tests pass, zero warnings
19 lines
452 B
Elixir
19 lines
452 B
Elixir
defmodule PinchflatWeb.Api.V1.FallbackController do
|
|
@moduledoc """
|
|
Translates controller failures into JSON error responses.
|
|
"""
|
|
use PinchflatWeb, :controller
|
|
|
|
def call(conn, {:error, :not_found}) do
|
|
conn
|
|
|> put_status(:not_found)
|
|
|> json(%{errors: %{detail: "Not found"}})
|
|
end
|
|
|
|
def call(conn, %Ecto.NoResultsError{} = _error) do
|
|
conn
|
|
|> put_status(:not_found)
|
|
|> json(%{errors: %{detail: "Not found"}})
|
|
end
|
|
end
|