module Bezel::ErrorPage
The answer to a request that raised: an HTTP::Error (Bezel::NotFound
and the others) with its status, anything else with 500.
In dev and test the page shows the exception's class and message,
its backtrace, and the request: method, path, parameters, session.
In prod it shows the status's reason only. Both come as HTML, or as
JSON when the request's Accept asks for JSON and not HTML.
Class methods
def self.response(conn: Bezel::Conn, error: Exception, status: Int) -> HTTP::Server::Response
The response to error raised for conn, with status.
def self.wants_json?(conn: Bezel::Conn) -> Bool
Whether conn's Accept asks for JSON and not HTML.
def self.escape(text: String) -> String
text escaped for HTML: &, <, >, " and '.