<!--
{
  "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/CBATTError-swift.struct",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Core Bluetooth"
    ],
    "preciseIdentifier" : "s:SC10CBATTErrorLeV"
  },
  "title" : "CBATTError"
}
-->

# CBATTError

An error that Core Bluetooth returns while using Attribute Protocol (ATT).

```
struct CBATTError
```

## Topics

### Inspecting Error Properties

### Error Codes

[`success`](/documentation/CoreBluetooth/CBATTError-swift.struct/success)

The ATT command or request successfully completed.

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

The attribute handle is invalid on this peripheral.

[`readNotPermitted`](/documentation/CoreBluetooth/CBATTError-swift.struct/readNotPermitted)

The permissions prohibit reading the attribute’s value.

[`writeNotPermitted`](/documentation/CoreBluetooth/CBATTError-swift.struct/writeNotPermitted)

The permissions prohibit writing the attribute’s value.

[`invalidPdu`](/documentation/CoreBluetooth/CBATTError-swift.struct/invalidPdu)

The attribute Protocol Data Unit (PDU) is invalid.

[`insufficientAuthentication`](/documentation/CoreBluetooth/CBATTError-swift.struct/insufficientAuthentication)

Reading or writing the attribute’s value failed for lack of authentication.

[`requestNotSupported`](/documentation/CoreBluetooth/CBATTError-swift.struct/requestNotSupported)

The attribute server doesn’t support the request received from the client.

[`invalidOffset`](/documentation/CoreBluetooth/CBATTError-swift.struct/invalidOffset)

The specified offset value was past the end of the attribute’s value.

[`insufficientAuthorization`](/documentation/CoreBluetooth/CBATTError-swift.struct/insufficientAuthorization)

Reading or writing the attribute’s value failed for lack of authorization.

[`prepareQueueFull`](/documentation/CoreBluetooth/CBATTError-swift.struct/prepareQueueFull)

The prepare queue is full, as a result of there being too many write requests in the queue.

[`attributeNotFound`](/documentation/CoreBluetooth/CBATTError-swift.struct/attributeNotFound)

The attribute wasn’t found within the specified attribute handle range.

[`attributeNotLong`](/documentation/CoreBluetooth/CBATTError-swift.struct/attributeNotLong)

The ATT read blob request can’t read or write the attribute.

[`insufficientEncryptionKeySize`](/documentation/CoreBluetooth/CBATTError-swift.struct/insufficientEncryptionKeySize)

The encryption key size used for encrypting this link is insufficient.

[`invalidAttributeValueLength`](/documentation/CoreBluetooth/CBATTError-swift.struct/invalidAttributeValueLength)

The length of the attribute’s value is invalid for the intended operation.

[`unlikelyError`](/documentation/CoreBluetooth/CBATTError-swift.struct/unlikelyError)

The ATT request encountered an unlikely error and wasn’t completed.

[`insufficientEncryption`](/documentation/CoreBluetooth/CBATTError-swift.struct/insufficientEncryption)

Reading or writing the attribute’s value failed for lack of encryption.

[`unsupportedGroupType`](/documentation/CoreBluetooth/CBATTError-swift.struct/unsupportedGroupType)

The attribute type isn’t a supported grouping attribute as defined by a higher-layer specification.

[`insufficientResources`](/documentation/CoreBluetooth/CBATTError-swift.struct/insufficientResources)

Resources are insufficient to complete the ATT request.

### Testing Error Inequality

### Enumerations

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

The possible errors returned by a GATT server (a remote peripheral) during Bluetooth low energy ATT transactions.

## Relationships

### Conforms To

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

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

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

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

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

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

---

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)