diff options
Diffstat (limited to 'lib/matrix_app_service_web/views/error_view.ex')
-rw-r--r-- | lib/matrix_app_service_web/views/error_view.ex | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/matrix_app_service_web/views/error_view.ex b/lib/matrix_app_service_web/views/error_view.ex index 2358355..ab705e1 100644 --- a/lib/matrix_app_service_web/views/error_view.ex +++ b/lib/matrix_app_service_web/views/error_view.ex @@ -1,11 +1,13 @@ defmodule MatrixAppServiceWeb.ErrorView do use MatrixAppServiceWeb, :view - # If you want to customize a particular status code - # for a certain format, you may uncomment below. - # def render("500.json", _assigns) do - # %{errors: %{detail: "Internal Server Error"}} - # end + def render("401.json", _assigns) do + %{errcode: "EX.MAP.UNAUTHORIZED"} + end + + def render("403.json", _assigns) do + %{errcode: "EX.MAP.FORBIDDEN"} + end # By default, Phoenix returns the status message from # the template name. For example, "404.json" becomes |