---
title: "finish(with:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avasynchronousciimagefilteringrequest/finish(with:)"
---

# finish(with:)

Notifies AVFoundation that you cannot fulfill the image filtering request.

## Declaration

```swift
func finish(with error: any Error)
```

## Parameters

- `error`: An error object describing the reason to

## Discussion

Discussion Call this method if you cannot process the input image and wish to abort playback as a result—for example, if the outputImage object from your filter chain is nil. (If instead you want to fall back to rendering an unfiltered image, call the finish(with:context:) and pass the sourceImage object to the filteredImage parameter.) Calling this method causes AVFoundation to post a notification named failedToPlayToEndTimeNotification. Observers of this notification can use the AVPlayerItemFailedToPlayToEndTimeErrorKey key to examine the error you provide.

## See Also

### Returning the filtered image

- [finish(with:context:)](avfoundation/avasynchronousciimagefilteringrequest/finish(with:context:).md)
