---
title: HMError.Code
framework: homekit
role: symbol
role_heading: Enumeration
path: homekit/hmerror/code
---

# HMError.Code

Possible error values that can be returned from HomeKit APIs.

## Declaration

```swift
enum Code
```

## Topics

### Accessory errors

- [HMError.Code.accessoryIsBlocked](homekit/hmerror/code/accessoryisblocked.md)
- [HMError.Code.accessoryIsBusy](homekit/hmerror/code/accessoryisbusy.md)
- [HMError.Code.accessoryIsSuspended](homekit/hmerror/code/accessoryissuspended.md)
- [HMError.Code.accessoryNotReachable](homekit/hmerror/code/accessorynotreachable.md)
- [HMError.Code.accessoryOutOfCompliance](homekit/hmerror/code/accessoryoutofcompliance.md)
- [HMError.Code.accessoryOutOfResources](homekit/hmerror/code/accessoryoutofresources.md)
- [HMError.Code.accessoryPoweredOff](homekit/hmerror/code/accessorypoweredoff.md)
- [HMError.Code.accessoryResponseError](homekit/hmerror/code/accessoryresponseerror.md)
- [HMError.Code.addAccessoryFailed](homekit/hmerror/code/addaccessoryfailed.md)
- [HMError.Code.incompatibleAccessory](homekit/hmerror/code/incompatibleaccessory.md)

### Action set errors

- [HMError.Code.actionInAnotherActionSet](homekit/hmerror/code/actioninanotheractionset.md)
- [HMError.Code.actionSetExecutionFailed](homekit/hmerror/code/actionsetexecutionfailed.md)
- [HMError.Code.actionSetExecutionInProgress](homekit/hmerror/code/actionsetexecutioninprogress.md)
- [HMError.Code.actionSetExecutionPartialSuccess](homekit/hmerror/code/actionsetexecutionpartialsuccess.md)
- [HMError.Code.cannotRemoveBuiltinActionSet](homekit/hmerror/code/cannotremovebuiltinactionset.md)
- [HMError.Code.noActionsInActionSet](homekit/hmerror/code/noactionsinactionset.md)
- [HMError.Code.noRegisteredActionSets](homekit/hmerror/code/noregisteredactionsets.md)

### Association errors

- [HMError.Code.invalidAssociatedServiceType](homekit/hmerror/code/invalidassociatedservicetype.md)
- [HMError.Code.objectAlreadyAssociatedToHome](homekit/hmerror/code/objectalreadyassociatedtohome.md)
- [HMError.Code.objectAssociatedToAnotherHome](homekit/hmerror/code/objectassociatedtoanotherhome.md)
- [HMError.Code.objectNotAssociatedToAnyHome](homekit/hmerror/code/objectnotassociatedtoanyhome.md)

### Authorization errors

- [HMError.Code.invalidOrMissingAuthorizationData](homekit/hmerror/code/invalidormissingauthorizationdata.md)
- [HMError.Code.locationForHomeDisabled](homekit/hmerror/code/locationforhomedisabled.md)
- [HMError.Code.homeAccessNotAuthorized](homekit/hmerror/code/homeaccessnotauthorized.md)
- [HMError.Code.insufficientPrivileges](homekit/hmerror/code/insufficientprivileges.md)
- [HMError.Code.messageAuthenticationFailed](homekit/hmerror/code/messageauthenticationfailed.md)
- [HMError.Code.notAuthorizedForLocationServices](homekit/hmerror/code/notauthorizedforlocationservices.md)
- [HMError.Code.notAuthorizedForMicrophoneAccess](homekit/hmerror/code/notauthorizedformicrophoneaccess.md)
- [HMError.Code.notSignedIntoiCloud](homekit/hmerror/code/notsignedintoicloud.md)
- [HMError.Code.ownershipFailure](homekit/hmerror/code/ownershipfailure.md)
- [HMError.Code.securityFailure](homekit/hmerror/code/securityfailure.md)

### Bridge errors

- [HMError.Code.bridgedAccessoryNotReachable](homekit/hmerror/code/bridgedaccessorynotreachable.md)
- [HMError.Code.cannotRemoveNonBridgeAccessory](homekit/hmerror/code/cannotremovenonbridgeaccessory.md)
- [HMError.Code.cannotUnblockNonBridgeAccessory](homekit/hmerror/code/cannotunblocknonbridgeaccessory.md)

### Characteristic errors

- [HMError.Code.readOnlyCharacteristic](homekit/hmerror/code/readonlycharacteristic.md)
- [HMError.Code.writeOnlyCharacteristic](homekit/hmerror/code/writeonlycharacteristic.md)

### Collision errors

- [HMError.Code.homeWithSimilarNameExists](homekit/hmerror/code/homewithsimilarnameexists.md)
- [HMError.Code.objectWithSimilarNameExists](homekit/hmerror/code/objectwithsimilarnameexists.md)
- [HMError.Code.objectWithSimilarNameExistsInHome](homekit/hmerror/code/objectwithsimilarnameexistsinhome.md)
- [HMError.Code.renameWithSimilarName](homekit/hmerror/code/renamewithsimilarname.md)

### Communication errors

- [HMError.Code.accessDenied](homekit/hmerror/code/accessdenied.md)
- [HMError.Code.accessoryCommunicationFailure](homekit/hmerror/code/accessorycommunicationfailure.md)
- [HMError.Code.accessoryPairingFailed](homekit/hmerror/code/accessorypairingfailed.md)
- [HMError.Code.accessorySentInvalidResponse](homekit/hmerror/code/accessorysentinvalidresponse.md)
- [HMError.Code.clientRequestError](homekit/hmerror/code/clientrequesterror.md)
- [HMError.Code.communicationFailure](homekit/hmerror/code/communicationfailure.md)
- [HMError.Code.dataResetFailure](homekit/hmerror/code/dataresetfailure.md)
- [HMError.Code.timedOutWaitingForAccessory](homekit/hmerror/code/timedoutwaitingforaccessory.md)

### Device and discovery errors

- [HMError.Code.deviceLocked](homekit/hmerror/code/devicelocked.md)
- [HMError.Code.accessoryDiscoveryFailed](homekit/hmerror/code/accessorydiscoveryfailed.md)

### General errors

- [HMError.Code.alreadyExists](homekit/hmerror/code/alreadyexists.md)
- [HMError.Code.genericError](homekit/hmerror/code/genericerror.md)
- [incompatibleHomeHub](homekit/hmerror/code/incompatiblehomehub.md)
- [HMError.Code.invalidClass](homekit/hmerror/code/invalidclass.md)
- [HMError.Code.notFound](homekit/hmerror/code/notfound.md)
- [HMError.Code.notificationAlreadyEnabled](homekit/hmerror/code/notificationalreadyenabled.md)
- [HMError.Code.notificationNotSupported](homekit/hmerror/code/notificationnotsupported.md)
- [HMError.Code.operationNotSupported](homekit/hmerror/code/operationnotsupported.md)
- [HMError.Code.unexpectedError](homekit/hmerror/code/unexpectederror.md)
- [HMError.Code.missingEntitlement](homekit/hmerror/code/missingentitlement.md)
- [HMError.Code.referToUserManual](homekit/hmerror/code/refertousermanual.md)

### Home and room errors

- [HMError.Code.maximumAccessoriesOfTypeInHome](homekit/hmerror/code/maximumaccessoriesoftypeinhome.md)
- [HMError.Code.roomForHomeCannotBeInZone](homekit/hmerror/code/roomforhomecannotbeinzone.md)
- [HMError.Code.roomForHomeCannotBeUpdated](homekit/hmerror/code/roomforhomecannotbeupdated.md)

### Hub errors

- [HMError.Code.noHomeHub](homekit/hmerror/code/nohomehub.md)
- [HMError.Code.noCompatibleHomeHub](homekit/hmerror/code/nocompatiblehomehub.md)

### Limit errors

- [HMError.Code.cannotActivateTriggerTooFarInFuture](homekit/hmerror/code/cannotactivatetriggertoofarinfuture.md)
- [HMError.Code.dateMustBeOnSpecifiedBoundaries](homekit/hmerror/code/datemustbeonspecifiedboundaries.md)
- [HMError.Code.fireDateInPast](homekit/hmerror/code/firedateinpast.md)
- [HMError.Code.invalidMessageSize](homekit/hmerror/code/invalidmessagesize.md)
- [HMError.Code.maximumObjectLimitReached](homekit/hmerror/code/maximumobjectlimitreached.md)
- [HMError.Code.recurrenceTooLarge](homekit/hmerror/code/recurrencetoolarge.md)
- [HMError.Code.recurrenceTooSmall](homekit/hmerror/code/recurrencetoosmall.md)
- [HMError.Code.recurrenceMustBeOnSpecifiedBoundaries](homekit/hmerror/code/recurrencemustbeonspecifiedboundaries.md)

### Network errors

- [HMError.Code.enterpriseNetworkNotSupported](homekit/hmerror/code/enterprisenetworknotsupported.md)
- [HMError.Code.failedToJoinNetwork](homekit/hmerror/code/failedtojoinnetwork.md)
- [HMError.Code.incompatibleNetwork](homekit/hmerror/code/incompatiblenetwork.md)
- [HMError.Code.networkUnavailable](homekit/hmerror/code/networkunavailable.md)
- [HMError.Code.wiFiCredentialGenerationFailed](homekit/hmerror/code/wificredentialgenerationfailed.md)

### Operation errors

- [HMError.Code.operationCancelled](homekit/hmerror/code/operationcancelled.md)
- [HMError.Code.operationInProgress](homekit/hmerror/code/operationinprogress.md)
- [HMError.Code.operationTimedOut](homekit/hmerror/code/operationtimedout.md)

### Parameter errors

- [HMError.Code.invalidParameter](homekit/hmerror/code/invalidparameter.md)
- [HMError.Code.missingParameter](homekit/hmerror/code/missingparameter.md)
- [HMError.Code.nilParameter](homekit/hmerror/code/nilparameter.md)
- [HMError.Code.unconfiguredParameter](homekit/hmerror/code/unconfiguredparameter.md)

### Read and write errors

- [HMError.Code.readWriteFailure](homekit/hmerror/code/readwritefailure.md)
- [HMError.Code.readWritePartialSuccess](homekit/hmerror/code/readwritepartialsuccess.md)

### Synchronization errors

- [HMError.Code.cloudDataSyncInProgress](homekit/hmerror/code/clouddatasyncinprogress.md)
- [HMError.Code.keychainSyncNotEnabled](homekit/hmerror/code/keychainsyncnotenabled.md)

### User errors

- [HMError.Code.userDeclinedAddingUser](homekit/hmerror/code/userdeclinedaddinguser.md)
- [HMError.Code.userDeclinedRemovingUser](homekit/hmerror/code/userdeclinedremovinguser.md)
- [HMError.Code.userDeclinedInvite](homekit/hmerror/code/userdeclinedinvite.md)
- [HMError.Code.userIDNotEmailAddress](homekit/hmerror/code/useridnotemailaddress.md)
- [HMError.Code.userManagementFailed](homekit/hmerror/code/usermanagementfailed.md)

### Value errors

- [HMError.Code.invalidDataFormatSpecified](homekit/hmerror/code/invaliddataformatspecified.md)
- [HMError.Code.invalidValueType](homekit/hmerror/code/invalidvaluetype.md)
- [HMError.Code.nameContainsProhibitedCharacters](homekit/hmerror/code/namecontainsprohibitedcharacters.md)
- [HMError.Code.nameDoesNotEndWithValidCharacters](homekit/hmerror/code/namedoesnotendwithvalidcharacters.md)
- [HMError.Code.nameDoesNotStartWithValidCharacters](homekit/hmerror/code/namedoesnotstartwithvalidcharacters.md)
- [HMError.Code.stringLongerThanMaximum](homekit/hmerror/code/stringlongerthanmaximum.md)
- [HMError.Code.stringShorterThanMinimum](homekit/hmerror/code/stringshorterthanminimum.md)
- [HMError.Code.valueHigherThanMaximum](homekit/hmerror/code/valuehigherthanmaximum.md)
- [HMError.Code.valueLowerThanMinimum](homekit/hmerror/code/valuelowerthanminimum.md)

### Enumeration Cases

- [HMError.Code.partialCommunicationFailure](homekit/hmerror/code/partialcommunicationfailure.md)
- [HMError.Code.homeUpgradeRequired](homekit/hmerror/code/homeupgraderequired.md)

### Initializers

- [init(rawValue:)](homekit/hmerror/code/init(rawvalue:).md)

## Relationships

### Conforms To

- [BitwiseCopyable](swift/bitwisecopyable.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [RawRepresentable](swift/rawrepresentable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Errors

- [HMError](homekit/hmerror.md)
- [HMErrorDomain](homekit/hmerrordomain.md)
- [HMErrorBlock](homekit/hmerrorblock.md)
