HBHTTPError

public struct HBHTTPError : Error, HBHTTPResponseError
extension HBHTTPError: CustomStringConvertible

Default HTTP error. Provides an HTTP status and a message is so desired

  • status code for the error

    Declaration

    Swift

    public let status: HTTPResponseStatus
  • any addiitional headers required

    Declaration

    Swift

    public let headers: HTTPHeaders
  • error payload, assumed to be a string

    Declaration

    Swift

    public let body: String?
  • Initialize HTTPError

    Declaration

    Swift

    public init(_ status: HTTPResponseStatus)

    Parameters

    status

    HTTP status

  • Initialize HTTPError

    Declaration

    Swift

    public init(_ status: HTTPResponseStatus, message: String)

    Parameters

    status

    HTTP status

    message

    Associated message

  • Get body of error as ByteBuffer

    Declaration

    Swift

    public func body(allocator: ByteBufferAllocator) -> ByteBuffer?
  • Description of error for logging

    Declaration

    Swift

    public var description: String { get }