Skip to content

Protocol

AbortError

Errors conforming to this protocol will always be displayed by Vapor to the end-user (even in production mode where most errors are silenced).
protocol AbortError : Error

Overview

extension MyError: AbortError { ... }
throw MyError(...) // Can now result in non-500 error.

See Abort for a default implementation of this protocol.

throw Abort(.badRequest, reason: "Something's not quite right...")

Topics

Instance Properties

  • headers
    Optional HTTPHeaders to add to the error response.
  • identifier
    See DebuggableError.
  • reason
    The reason for this error.
  • status
    The HTTP status code this error will return.

Relationships

Inherits From

  • Swift.Error
  • Swift.Sendable
  • Swift.SendableMetatype

Conforming Types