title: Vapor 3 - Returning a different Future when a search fails?
body: <p>I'm using Vapor 3 and linking to a FoundationDB database, so Im not using Fluent. I have a method that searches for a record, but it will obviously crash if it does not return a record (because I force unwrap the value).</p>
  
  <p>I want to guard the reading from the database and return a response if no record is found. This will however not be the record as was expected in the Future. I was thinking that I should return a different response, but am unsure how to change the result that is expected.</p>
  
  <pre><code>//creates a specific country
  func getCountry( req: Request) throws -&gt; Future&lt;Country&gt; {
      // get Country name from get parameter string
      let countryString = try req.parameters.next(String.self)
  
  
      // get record from Database. This could fail and so needs to be guarded. What response should be returned as the Future requires a Country datatype?
  
         let record =  FDBConnector().getRecord(path: Subspace("iVendor").subspace(["Countries", countryString]))
  
  
  
      let newCountry = try JSONDecoder().decode(Country.self, from: record!)
      // return Country Struct
      return Future.map(on: req) {return newCountry }
  
  }
  </code></pre>