Skip to content

class HTTP::ErrorHandler
inherits Reference

A handler that invokes the next handler and, if that next handler raises an exception, returns with a 500 (Internal Server Error) status code.

In verbose mode prints the exception with its backtrace to the response. Otherwise a generic error message is returned to the client.

This handler also logs the exceptions to the specified logger or the logger for the source "http.server" by default.

Included modules

HTTP::Handler

Class methods

.new(verbose : Bool = false, log = Log.for("http.server"))

View source

Methods

#call(context)

View source