---
title: "centralManager(_:didFailToConnect:error:)"
framework: corebluetooth
role: symbol
role_heading: Instance Method
path: "corebluetooth/cbcentralmanagerdelegate/centralmanager(_:didfailtoconnect:error:)"
---

# centralManager(_:didFailToConnect:error:)

Tells the delegate the central manager failed to create a connection with a peripheral.

## Declaration

```swift
optional func centralManager(_ central: CBCentralManager, didFailToConnect peripheral: CBPeripheral, error: (any Error)?)
```

## Parameters

- `central`: The central manager that provides this information.
- `peripheral`: The peripheral that failed to connect.
- `error`: The cause of the failure, or nil if no error occurred.

## Discussion

Discussion The manager invokes this method when a connection initiated with the connect(_:options:) method fails to complete. Because connection attempts don’t time out, a failed connection usually indicates a transient issue, in which case you may attempt connecting to the peripheral again.

## See Also

### Monitoring Connections with Peripherals

- [centralManager(_:didConnect:)](corebluetooth/cbcentralmanagerdelegate/centralmanager(_:didconnect:).md)
- [centralManager(_:didDisconnectPeripheral:error:)](corebluetooth/cbcentralmanagerdelegate/centralmanager(_:diddisconnectperipheral:error:).md)
- [centralManager(_:connectionEventDidOccur:for:)](corebluetooth/cbcentralmanagerdelegate/centralmanager(_:connectioneventdidoccur:for:).md)
