Files
customer-service/lib/customer_service_web/controllers/error_json.ex
HaimKortovich b1b1c21e4e
Some checks failed
Build and Publish / build-release (push) Failing after 1s
init commit
2026-04-15 16:20:22 -05:00

18 lines
452 B
Elixir

defmodule CustomerServiceWeb.ErrorJSON do
@moduledoc """
This module is invoked by your endpoint in case of errors on JSON requests.
"""
def render("404.json", _assigns) do
%{errors: %{detail: "Not Found"}}
end
def render("500.json", _assigns) do
%{errors: %{detail: "Internal Server Error"}}
end
def render(template, _assigns) do
%{errors: %{detail: Phoenix.Controller.status_message_from_template(template)}}
end
end