ErrorView
Bastion.ErrorView — default HTML error page rendering.
Renders user-friendly error pages for common HTTP status codes. Used by FallbackController and the router's default 404 handler.
Example:
let html = ErrorView.render(404, "The page you were looking for does not exist.")
Response.html(conn, 404, html)Functions
Return a default user-facing message for a given status code.
Render an HTML error page for the given HTTP status code and message.
Returns a complete HTML document string with inline styling. The message
argument is HTML-escaped before being inserted into the page so that
user-controlled content cannot inject markup or scripts.
Example:
ErrorView.render(404, "Not Found")Render a minimal error page using a default message for the given status code.
Example:
ErrorView.render_default(500)Return the standard HTTP status text for a given status code.
Example:
ErrorView.status_text(404) -- => "Not Found"