diff --git a/Sources/APIErrorMiddleware/APIErrorMiddleware.swift b/Sources/APIErrorMiddleware/APIErrorMiddleware.swift index 3f99683..c90327e 100644 --- a/Sources/APIErrorMiddleware/APIErrorMiddleware.swift +++ b/Sources/APIErrorMiddleware/APIErrorMiddleware.swift @@ -24,7 +24,7 @@ public final class APIErrorMiddleware: Middleware, Service, ServiceType { /// Creates a service instance. Used by a `ServiceFactory`. public static func makeService(for worker: Container) throws -> APIErrorMiddleware { - return APIErrorMiddleware() + return APIErrorMiddleware(environment: worker.environment, specializations: [ModelNotFound()]) } /// Catch all errors thrown by the route handler or