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

# calendarViewController(_:didEncounterError:)

Notifies the delegate when an unhandled error is encounted in a calendar view controller.

## Declaration

```swift
func calendarViewController<C, VS>(_ viewController: OCKCalendarViewController<C, VS>, didEncounterError: Error) where C : OCKCalendarControllerProtocol, VS : OCKCalendarViewSynchronizerProtocol
```

## Parameters

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