class Amber::Pipe::Error

Overview

The Error pipe catches RouteNotFound and returns a 404. It responds based on the Accepts header as JSON or HTML. It also catches any runtime Exceptions and returns a backtrace in text/html format.

Defined in:

amber/pipes/error.cr

Constant Summary

Log = ::Log.for("error")

Instance Method Summary

Instance methods inherited from class Amber::Pipe::Base

call(context : HTTP::Server::Context) call

Instance Method Detail

def call(context : HTTP::Server::Context) #

Renders the error page for an exception raised further down the pipeline. An exception raised after the response's status line and headers went to the client is raised again instead: the page can no longer replace them, and the HTTP server logs it and closes the connection.


[View source]