---
title: "contactViewController(_:didEncounterError:)"
framework: CareKit
role: symbol
role_heading: Instance Method
platforms: [iOS 13.0+, Mac Catalyst 13.0+, watchOS 7.0+]
path: "carekit/ockcontactviewcontrollerdelegate/contactviewcontroller(_:didencountererror:)"
---

# contactViewController(_:didEncounterError:)

Notifies the delegate when an unhandled error is encountered in a contact view controller.

## Declaration

```swift
func contactViewController<C, VS>(_ viewController: OCKContactViewController<C, VS>, didEncounterError: Error) where C : OCKContactControllerProtocol, VS : OCKContactViewSynchronizerProtocol
```

## Parameters

- `viewController`: The view controller in which the error occurred.
- `didEncounterError`: The error that occurred.
