---
title: "turnBasedMatchmakerViewController(_:didFailWithError:)"
framework: gamekit
role: symbol
role_heading: Instance Method
path: "gamekit/gkturnbasedmatchmakerviewcontrollerdelegate/turnbasedmatchmakerviewcontroller(_:didfailwitherror:)"
---

# turnBasedMatchmakerViewController(_:didFailWithError:)

Handles when an error occurs while the local player invites other players.

## Declaration

```swift
func turnBasedMatchmakerViewController(_ viewController: GKTurnBasedMatchmakerViewController, didFailWithError error: any Error)
```

## Parameters

- `viewController`: The view controller that encounters an error.
- `error`: The error that occurs.

## Discussion

Discussion This method needs to dismiss the view controller.

## See Also

### Handling Cancellation and Errors

- [turnBasedMatchmakerViewControllerWasCancelled(_:)](gamekit/gkturnbasedmatchmakerviewcontrollerdelegate/turnbasedmatchmakerviewcontrollerwascancelled(_:).md)
