Ch. 7 - Filter - No calls to throwing functions occur within 'try' expression

Hi,

When I’m doing a filter such as that one :

router.get("api", "acronyms", "search") { req -> Future<[Acronym]> in
    guard
        let searchTerm = req.query[String.self, at: "term"] else {
            throw Abort(.badRequest)
    }
    return try Acronym.query(on: req).group(.or) { or in
         try or.filter(\.short == searchTerm)
         try or.filter(\.long == searchTerm)
    }.all()
}

I got an alert message aligned with the “try or.filter” line saying that “No calls to throwing functions occur within ‘try’ expression”. It stills working, I’m just wondering what causes the error ?

@nidupb this is because the latest Fluent RC release changed whether functions throw or not - you can just remove the redundant trys. This will be fixed in the next release!