<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 4.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreBluetooth",
  "identifier" : "/documentation/CoreBluetooth/CBError-swift.struct",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Core Bluetooth"
    ],
    "preciseIdentifier" : "s:SC7CBErrorLeV"
  },
  "title" : "CBError"
}
-->

# CBError

An error that Core Bluetooth returns during Bluetooth transactions.

```
struct CBError
```

## Topics

### Inspecting Error Properties

### Error Codes

[`unknown`](/documentation/CoreBluetooth/CBError-swift.struct/unknown)

An unknown error occurred.

[`invalidParameters`](/documentation/CoreBluetooth/CBError-swift.struct/invalidParameters)

The specified parameters are invalid.

[`invalidHandle`](/documentation/CoreBluetooth/CBError-swift.struct/invalidHandle)

The specified attribute handle is invalid.

[`notConnected`](/documentation/CoreBluetooth/CBError-swift.struct/notConnected)

The device isn’t currently connected.

[`outOfSpace`](/documentation/CoreBluetooth/CBError-swift.struct/outOfSpace)

The device has run out of space to complete the intended operation.

[`operationCancelled`](/documentation/CoreBluetooth/CBError-swift.struct/operationCancelled)

The error represents a canceled operation.

[`connectionTimeout`](/documentation/CoreBluetooth/CBError-swift.struct/connectionTimeout)

The connection timed out.

[`peripheralDisconnected`](/documentation/CoreBluetooth/CBError-swift.struct/peripheralDisconnected)

The peripheral disconnected.

[`uuidNotAllowed`](/documentation/CoreBluetooth/CBError-swift.struct/uuidNotAllowed)

The specified UUID isn’t permitted.

[`alreadyAdvertising`](/documentation/CoreBluetooth/CBError-swift.struct/alreadyAdvertising)

The peripheral is already advertising.

[`connectionFailed`](/documentation/CoreBluetooth/CBError-swift.struct/connectionFailed)

The connection failed.

[`connectionLimitReached`](/documentation/CoreBluetooth/CBError-swift.struct/connectionLimitReached)

The device already has the maximum number of connections.

[`operationNotSupported`](/documentation/CoreBluetooth/CBError-swift.struct/operationNotSupported)

The operation isn’t supported.

[`unknownDevice`](/documentation/CoreBluetooth/CBError-swift.struct/unknownDevice)

The device is unknown.

[`unkownDevice`](/documentation/CoreBluetooth/CBError-swift.struct/unkownDevice)

A misspelled version of the unknown device error code.

### Testing Error Inequality

### Type Properties

[`encryptionTimedOut`](/documentation/CoreBluetooth/CBError-swift.struct/encryptionTimedOut)

[`leGattExceededBackgroundNotificationLimit`](/documentation/CoreBluetooth/CBError-swift.struct/leGattExceededBackgroundNotificationLimit)

[`leGattNearBackgroundNotificationLimit`](/documentation/CoreBluetooth/CBError-swift.struct/leGattNearBackgroundNotificationLimit)

[`peerRemovedPairingInformation`](/documentation/CoreBluetooth/CBError-swift.struct/peerRemovedPairingInformation)

[`tooManyLEPairedDevices`](/documentation/CoreBluetooth/CBError-swift.struct/tooManyLEPairedDevices)

### Enumerations

[`Code`](/documentation/CoreBluetooth/CBError-swift.struct/Code)

The codes for errors that Core Bluetooth returns during Bluetooth transactions.

## Relationships

### Conforms To

[`Error`](/documentation/Swift/Error)

[`Equatable`](/documentation/Swift/Equatable)

[`Hashable`](/documentation/Swift/Hashable)

[`CustomNSError`](/documentation/Foundation/CustomNSError)

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

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)