<!--
{
  "availability" : [
    "iOS: 10.0.0 - 27.0.0",
    "iPadOS: 10.0.0 - 27.0.0",
    "macCatalyst: 13.1.0 - 27.0.0",
    "macOS: 11.0.0 - 27.0.0",
    "tvOS: 10.0.0 - 27.0.0",
    "visionOS: 1.0.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "ReplayKit",
  "identifier" : "/documentation/ReplayKit/RPBroadcastSampleHandler/finishBroadcastWithError(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "ReplayKit"
    ],
    "preciseIdentifier" : "c:objc(cs)RPBroadcastSampleHandler(im)finishBroadcastWithError:"
  },
  "title" : "finishBroadcastWithError(_:)"
}
-->

# finishBroadcastWithError(_:)

Stops the broadcast and passes an error back to the broadcasting app.

```
func finishBroadcastWithError(_ error: any Error)
```

## Parameters

`error`

An NSError object that is passed back to the broadcasting app through the [`broadcastController(_:didFinishWithError:)`](/documentation/ReplayKit/RPBroadcastControllerDelegate/broadcastController(_:didFinishWithError:)) method.

## Discussion

Call this method in your sample handler when it cannot proceed due to an error.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)