<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreHaptics",
  "identifier" : "/documentation/CoreHaptics/CHHapticError/Code",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Core Haptics"
    ],
    "preciseIdentifier" : "c:@E@CHHapticErrorCode"
  },
  "title" : "CHHapticError.Code"
}
-->

# CHHapticError.Code

Error codes for framework operations.

```
enum Code
```

## Topics

### Error Codes

[`CHHapticErrorCodeBadEventEntry`](/documentation/CoreHaptics/CHHapticError/Code/badEventEntry)

An event is missing a required field.

[`CHHapticErrorCodeBadParameterEntry`](/documentation/CoreHaptics/CHHapticError/Code/badParameterEntry)

A parameter in an event is missing a required field.

[`CHHapticErrorCodeEngineNotRunning`](/documentation/CoreHaptics/CHHapticError/Code/engineNotRunning)

Your app requested haptic playback when the engine wasn’t running.

[`CHHapticErrorCodeEngineStartTimeout`](/documentation/CoreHaptics/CHHapticError/Code/engineStartTimeout)

The haptic engine timed out while starting.

[`CHHapticErrorCodeFileNotFound`](/documentation/CoreHaptics/CHHapticError/Code/fileNotFound)

The system couldn’t find an audio file or haptic asset.

[`CHHapticErrorCodeInsufficientPower`](/documentation/CoreHaptics/CHHapticError/Code/insufficientPower)

The operation failed due to power restrictions.

[`CHHapticErrorCodeInvalidAudioResource`](/documentation/CoreHaptics/CHHapticError/Code/invalidAudioResource)

A pattern dictionary or an event array contain a reference to an invalid audio resource.

[`CHHapticErrorCodeInvalidAudioSession`](/documentation/CoreHaptics/CHHapticError/Code/invalidAudioSession)

The system invalidated the audio session associated with the haptic engine.

[`CHHapticErrorCodeInvalidEngineParameter`](/documentation/CoreHaptics/CHHapticError/Code/invalidEngineParameter)

Your app attempted to initialize the haptic engine with an invalid configuration parameter.

[`CHHapticErrorCodeInvalidEventDuration`](/documentation/CoreHaptics/CHHapticError/Code/invalidEventDuration)

An event in the dictionary has an invalid duration.

[`CHHapticErrorCodeInvalidEventTime`](/documentation/CoreHaptics/CHHapticError/Code/invalidEventTime)

The time of an event in the dictionary is invalid.

[`CHHapticErrorCodeInvalidEventType`](/documentation/CoreHaptics/CHHapticError/Code/invalidEventType)

The type of an event in the dictionary is invalid.

[`CHHapticErrorCodeInvalidParameterType`](/documentation/CoreHaptics/CHHapticError/Code/invalidParameterType)

A pattern dictionary or parameter array contains an unknown or invalid parameter type.

[`CHHapticErrorCodeInvalidPatternData`](/documentation/CoreHaptics/CHHapticError/Code/invalidPatternData)

Your app passed an invalid pattern to the haptic engine or player.

[`CHHapticErrorCodeInvalidPatternDictionary`](/documentation/CoreHaptics/CHHapticError/Code/invalidPatternDictionary)

A pattern in the dictionary is missing a required field.

[`CHHapticErrorCodeInvalidPatternPlayer`](/documentation/CoreHaptics/CHHapticError/Code/invalidPatternPlayer)

The current pattern player is no longer valid due to a server error.

[`CHHapticErrorCodeInvalidTime`](/documentation/CoreHaptics/CHHapticError/Code/invalidTime)

The time offset passed to the haptic engine is invalid.

[`CHHapticErrorCodeMemoryError`](/documentation/CoreHaptics/CHHapticError/Code/memoryError)

The operation failed due to a lack of memory.

[`CHHapticErrorCodeNotSupported`](/documentation/CoreHaptics/CHHapticError/Code/notSupported)

The current device doesn’t support the haptic engine.

[`CHHapticErrorCodeOperationNotPermitted`](/documentation/CoreHaptics/CHHapticError/Code/operationNotPermitted)

Your app requested an operation that the haptic engine disallows.

[`CHHapticErrorCodeResourceNotAvailable`](/documentation/CoreHaptics/CHHapticError/Code/resourceNotAvailable)

The requested operation couldn’t finish due to a limit on available resources.

[`CHHapticErrorCodeServerInterrupted`](/documentation/CoreHaptics/CHHapticError/Code/serverInterrupted)

Your app lost its connection to the haptic server.

[`CHHapticErrorCodeServerInitFailed`](/documentation/CoreHaptics/CHHapticError/Code/serverInitFailed)

The haptic server failed to initialize.

[`CHHapticErrorCodeUnknownError`](/documentation/CoreHaptics/CHHapticError/Code/unknownError)

An operation failed due to an unknown error.

## Relationships

### Conforms To

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

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

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

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

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

[`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)