Structurehummingbird 2.10.0Hummingbird
HTTPError
Default HTTP error. Provides an HTTP status and a message
struct HTTPError
Default HTTP error. Provides an HTTP status and a message
struct HTTPError
import Hummingbird
protocol Copyable
A type whose values can be implicitly or explicitly copied.
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Error : Sendable
A type representing an error value that can be thrown.
protocol Escapable
protocol HTTPResponseError : ResponseGenerator, Error
An error that is capable of generating an HTTP response
protocol ResponseGenerator
Object that can generate a Response
.
protocol Sendable
init(_ status: HTTPResponse.Status)
Initialize HTTPError
init(_ status: HTTPResponse.Status, headers: HTTPFields, message: String? = nil)
Initialize HTTPError
init(_ status: HTTPResponse.Status, message: String)
Initialize HTTPError
var body: String?
error message
var description: String { get }
Description of error for logging
var headers: HTTPFields
response headers
var status: HTTPResponse.Status
func response(from request: Request, context: some RequestContext) throws -> Response
var localizedDescription: String { get }
Retrieve the localized description for this error.