Created
February 21, 2015 10:30
-
-
Save saa/c175ae731e32790de17f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Pibblex.ErrorView do | |
use Pibblex.View | |
def render("404.json", _assings) do | |
%{errors: [%{message: "Not Found", code: :not_found}]} | |
end | |
def render("404.html", _assigns) do | |
%{errors: [%{message: "Not Found", code: :not_found}]} | |
end | |
def render("500.html", _assigns) do | |
"Server internal error - 500" | |
end | |
# Render all other templates as 500 | |
def render(_, assigns) do | |
render "500.html", assigns | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment