<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "VisionKit",
  "identifier" : "/documentation/VisionKit/VNDocumentCameraViewControllerDelegate/documentCameraViewController(_:didFailWithError:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "VisionKit"
    ],
    "preciseIdentifier" : "c:objc(pl)VNDocumentCameraViewControllerDelegate(im)documentCameraViewController:didFailWithError:"
  },
  "title" : "documentCameraViewController(_:didFailWithError:)"
}
-->

# documentCameraViewController(_:didFailWithError:)

Tells the delegate that document scanning failed while the camera view controller was active.

```
optional func documentCameraViewController(_ controller: VNDocumentCameraViewController, didFailWithError error: any Error)
```

## Parameters

`controller`

The document camera view controller that failed.

`error`

The error containing the reason for failure.

---

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)