Skip to content

You're viewing documentation for a pre-release version. View the latest stable version

Type Method

default(environment:)

Create a default ErrorMiddleware. Logs each error at its DebuggableError/logLevel, or .debug for an error that isn’t a DebuggableError, and converts Error to Response based on Environment and on conformance to AbortError and Debuggable.
static func `default`(environment: Environment) -> ErrorMiddleware

Parameters

environment

The environment to respect when presenting errors.

Discussion

To report errors at a different level, give them a logLevel or use your own ErrorMiddleware.