---
title: "completer(_:didFailWithError:)"
framework: mapkit
role: symbol
role_heading: Instance Method
path: "mapkit/mklocalsearchcompleterdelegate/completer(_:didfailwitherror:)"
---

# completer(_:didFailWithError:)

Tells the method when the specified search completer is unable to generate a list of search results.

## Declaration

```swift
optional func completer(_ completer: MKLocalSearchCompleter, didFailWithError error: any Error)
```

## Parameters

- `completer`: The search completer object reporting the error.
- `error`: The error object containing the reason for the failure.

## Discussion

Discussion Use this object to process any errors that occur while generating search results. Even when an error occurs, the search completer starts a new search if it already has a new search string. Depending on the error, you might do nothing or let the user know that you were unable to obtain a list of search completions.

## See Also

### Getting the search results

- [completerDidUpdateResults(_:)](mapkit/mklocalsearchcompleterdelegate/completerdidupdateresults(_:).md)
