SiteNoRouteErrorMiddleware
public final class SiteNoRouteErrorMiddleware : AsyncMiddleware
Catches 404 errors where we don’t match any route, genrates HTML error pages for them unless the path starts with /api/v3
.
Must be installed as a global middleware (via app.middleware) to work, since it needs to be called for paths that don’t mach routes.
-
Declaration
Swift
var isReleaseMode: Bool
-
handleError(req:
Asynchronouserror: ) Declaration
Swift
func handleError(req: Request, error: Error) async throws -> Response
-
Declaration
Swift
init(environment: Environment)
-
respond(to:
AsynchronouschainingTo: ) See
Middleware
.Declaration
Swift
public func respond(to request: Request, chainingTo next: AsyncResponder) async throws -> Response