aboutsummaryrefslogtreecommitdiff
path: root/web/views
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--web/views/error_view.ex11
1 files changed, 11 insertions, 0 deletions
diff --git a/web/views/error_view.ex b/web/views/error_view.ex
index e47ebee..5906829 100644
--- a/web/views/error_view.ex
+++ b/web/views/error_view.ex
@@ -14,4 +14,15 @@ defmodule TheTranscriberBackend.ErrorView do
def template_not_found(_template, assigns) do
render "500.html", assigns
end
+
+ def render("404.json", %{reason: reason}) do
+ message = case reason do
+ %Phoenix.Router.NoRouteError{} -> "Route not found"
+ %Ecto.NoResultsError{} -> "File not found in database !"
+ _ -> "Uncaught exception"
+ end
+ # ContactService.ResponseHelper.error(message)
+ %{error: message}
+end
+
end