<!--
{
  "availability" : [
    "iOS: 3.0.0 - 7.0.0",
    "iPadOS: 3.0.0 - 7.0.0",
    "tvOS: 9.0.0 - 18.4.0",
    "visionOS: 1.0.0 - 1.0.0",
    "watchOS: 3.0.0 - 3.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "GameKit",
  "identifier" : "/documentation/GameKit/GKSessionError-swift.struct/Code",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "GameKit"
    ],
    "preciseIdentifier" : "c:@E@GKSessionError"
  },
  "title" : "GKSessionError.Code"
}
-->

# GKSessionError.Code

Error codes for the session error domain.

```
enum Code
```

## Topics

### Constants

[`case invalidParameterError`](/documentation/GameKit/GKSessionError-swift.struct/Code/invalidParameterError)

A parameter had an unexpected value.

[`case peerNotFoundError`](/documentation/GameKit/GKSessionError-swift.struct/Code/peerNotFoundError)

A peer with the specified `peerID` string could not be found.

[`case declinedError`](/documentation/GameKit/GKSessionError-swift.struct/Code/declinedError)

The peer your application tried to connect to refused the connection.

[`case timedOutError`](/documentation/GameKit/GKSessionError-swift.struct/Code/timedOutError)

The operation could not be completed in the specified timeout period.

[`case cancelledError`](/documentation/GameKit/GKSessionError-swift.struct/Code/cancelledError)

A peer that invited the session to connect to them canceled the connection request.

[`case connectionFailedError`](/documentation/GameKit/GKSessionError-swift.struct/Code/connectionFailedError)

The attempt to establish a connection with another peer failed.

[`case connectionClosedError`](/documentation/GameKit/GKSessionError-swift.struct/Code/connectionClosedError)

The connection to another peer closed unexpectedly.

[`case dataTooBigError`](/documentation/GameKit/GKSessionError-swift.struct/Code/dataTooBigError)

The data your application attempted to send was too large for the session to transmit in a single call.

[`case notConnectedError`](/documentation/GameKit/GKSessionError-swift.struct/Code/notConnectedError)

Reserved for future use.

[`case cannotEnableError`](/documentation/GameKit/GKSessionError-swift.struct/Code/cannotEnableError)

Bluetooth is not currently available.

[`case inProgressError`](/documentation/GameKit/GKSessionError-swift.struct/Code/inProgressError)

The peer your application attempted to connect to has already requested a connection to your session.

[`case connectivityError`](/documentation/GameKit/GKSessionError-swift.struct/Code/connectivityError)

An error occurred in the [`GKSession`](/documentation/GameKit/GKSession) object’s connection code.

[`case transportError`](/documentation/GameKit/GKSessionError-swift.struct/Code/transportError)

An error occurred in the [`GKSession`](/documentation/GameKit/GKSession) object’s transport code.

[`case internalError`](/documentation/GameKit/GKSessionError-swift.struct/Code/internalError)

A serious error occurred inside [`GKSession`](/documentation/GameKit/GKSession).

[`case unknownError`](/documentation/GameKit/GKSessionError-swift.struct/Code/unknownError)

Reserved for when the error does not fit in another category above.

[`case systemError`](/documentation/GameKit/GKSessionError-swift.struct/Code/systemError)

An error occurred outside of the [`GKSession`](/documentation/GameKit/GKSession) object’s control, such as memory allocation.

### Initializers

[`init?(rawValue: Int32)`](/documentation/GameKit/GKSessionError-swift.struct/Code/init(rawValue:))

## Relationships

### Conforms To

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

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

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

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

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

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

---

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)