---
title: "finishEnumeratingWithError(_:)"
framework: fileprovider
role: symbol
role_heading: Instance Method
path: "fileprovider/nsfileprovidersearchenumerationobserver/finishenumeratingwitherror(_:)"
---

# finishEnumeratingWithError(_:)

Finishes a search enumeration by sending an error to the framework.

## Declaration

```swift
func finishEnumeratingWithError(_ error: any Error)
```

## Discussion

Discussion Finishing with an error causes the system to stop requesting additional pages of results. The system doesn’t retry after you call this method. If an error is potentially recoverable, you can perform your own retry in your implementation of enumerateSearchResults(for:startingAt:) and continue if successful, or end the query by calling this method.

## See Also

### Ending enumeration

- [finishEnumerating(upTo:)](fileprovider/nsfileprovidersearchenumerationobserver/finishenumerating(upto:).md)
