<!--
{
  "availability" : [
    "iOS: 18.1.0 -",
    "iPadOS: 18.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SecureElementCredential",
  "identifier" : "/documentation/SecureElementCredential/CredentialSession/ErrorCode",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "SecureElementCredential"
    ],
    "preciseIdentifier" : "s:23SecureElementCredential0C7SessionC9ErrorCodeO"
  },
  "title" : "CredentialSession.ErrorCode"
}
-->

# CredentialSession.ErrorCode

An error encountered by a credential session.

```
enum ErrorCode
```

## Topics

### Authorization and permission error codes

[`case userNotAuthorized`](/documentation/SecureElementCredential/CredentialSession/ErrorCode/userNotAuthorized)

The person using the app isn’t authorized to perform the operation.

[`case accessDenied`](/documentation/SecureElementCredential/CredentialSession/ErrorCode/accessDenied)

The person using the app declined to grant permission for the operation.

[`case clientNotInForeground`](/documentation/SecureElementCredential/CredentialSession/ErrorCode/clientNotInForeground)

Your app isn’t in the foreground, which is required to use the credential session.

[`case userCanceledAuthorization`](/documentation/SecureElementCredential/CredentialSession/ErrorCode/userCanceledAuthorization)

The person using the app dismissed the authorization sheet.

[`case userAuthorizationTimedOut`](/documentation/SecureElementCredential/CredentialSession/ErrorCode/userAuthorizationTimedOut)

Authorization timed out while waiting for the person using the app.

[`case featureUnavailable`](/documentation/SecureElementCredential/CredentialSession/ErrorCode/featureUnavailable)

The feature is unavailable.

[`case ineligible`](/documentation/SecureElementCredential/CredentialSession/ErrorCode/ineligible)

The current device and user configuation are ineligible to use this service.

[`case conditionsNotSatisfied`](/documentation/SecureElementCredential/CredentialSession/ErrorCode/conditionsNotSatisfied)

The iCloud account or passcode of the person using the app don’t satisfy the conditions to use this service.

### Credential error codes

[`case invalidCredentialState`](/documentation/SecureElementCredential/CredentialSession/ErrorCode/invalidCredentialState)

A credential is in a state that doesn’t permit that function.

[`case credentialDoesNotExist`](/documentation/SecureElementCredential/CredentialSession/ErrorCode/credentialDoesNotExist)

The credential doesn’t exist, or you don’t have access to it.

[`case instanceDoesNotExist`](/documentation/SecureElementCredential/CredentialSession/ErrorCode/instanceDoesNotExist)

The instance doesn’t exist in the target credential.

### Session error codes

[`case invalidSessionState`](/documentation/SecureElementCredential/CredentialSession/ErrorCode/invalidSessionState)

The session is in a state that doesn’t permit that function.

[`case sessionInvalidated`](/documentation/SecureElementCredential/CredentialSession/ErrorCode/sessionInvalidated)

The client requested invalidation of the session.

### Command error codes

[`case commandNotSupported`](/documentation/SecureElementCredential/CredentialSession/ErrorCode/commandNotSupported)

Your app attempted an unsupported Secure Element command.

### Network-related error codes

[`case network`](/documentation/SecureElementCredential/CredentialSession/ErrorCode/network)

The device’s internet connection is offline.

### Presentment intent assertion error codes

[`case presentmentIntentAssertionTimeout`](/documentation/SecureElementCredential/CredentialSession/ErrorCode/presentmentIntentAssertionTimeout)

The presentment intent assertion timed out.

### UIKit error codes

[`case invalidView`](/documentation/SecureElementCredential/CredentialSession/ErrorCode/invalidView)

The provided UIKit view is invalid.

### Hardware error codes

[`case insufficientSpace`](/documentation/SecureElementCredential/CredentialSession/ErrorCode/insufficientSpace)

The hardware storage has insufficient space for the attempted provisioning.

### Temporary error codes

[`case resourceUnavailable`](/documentation/SecureElementCredential/CredentialSession/ErrorCode/resourceUnavailable)

The requested resource is unavailable.

[`case acquiredResourceRelinquished`](/documentation/SecureElementCredential/CredentialSession/ErrorCode/acquiredResourceRelinquished)

The system relinquished an underlying shared resource, preventing the operation from completing.

### Miscellaneous error codes

[`case invalidInput`](/documentation/SecureElementCredential/CredentialSession/ErrorCode/invalidInput)

One or more parameters is invalid.

[`case internalError`](/documentation/SecureElementCredential/CredentialSession/ErrorCode/internalError)

The framework encountered an internal error.

### Enumeration Cases

[`case invalidProductConfigID`](/documentation/SecureElementCredential/CredentialSession/ErrorCode/invalidProductConfigID)

The product configuration ID is invalid.

### Instance Properties

[`var failureReason: String?`](/documentation/SecureElementCredential/CredentialSession/ErrorCode/failureReason)

A string representation of the error code.

## Relationships

### Conforms To

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

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

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

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

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

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

---

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)