Skip to content

Commit 5e31cf6

Browse files
authored
Fixed one more compilation error
1 parent e576f23 commit 5e31cf6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/APIErrorMiddleware/APIErrorMiddleware.swift

+5-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ public final class APIErrorMiddleware: Middleware, Service, ServiceType {
2424

2525
/// Creates a service instance. Used by a `ServiceFactory`.
2626
public static func makeService(for worker: Container) throws -> APIErrorMiddleware {
27-
return APIErrorMiddleware(environment: worker.environment, specializations: [ModelNotFound()])
27+
#if canImport(Fluent)
28+
return APIErrorMiddleware(environment: worker.environment, specializations: [ModelNotFound()])
29+
#else
30+
return APIErrorMiddleware(environment: worker.environment, specializations: [])
31+
#endif
2832
}
2933

3034
/// Catch all errors thrown by the route handler or

0 commit comments

Comments
 (0)