diff --git a/src/darwin/Framework/CHIP/CHIPError.h b/src/darwin/Framework/CHIP/CHIPError.h index 883d38f5e83402..aa57c37302a399 100644 --- a/src/darwin/Framework/CHIP/CHIPError.h +++ b/src/darwin/Framework/CHIP/CHIPError.h @@ -37,6 +37,7 @@ typedef NS_ERROR_ENUM(CHIPErrorDomain, CHIPErrorCode){ CHIPErrorCodeUnsupportedAttribute = 0x86, CHIPErrorCodeConstraintError = 0x87, CHIPErrorCodeUnsupportedWrite = 0x88, + CHIPErrorCodeNotFound = 0x8B, CHIPErrorCodeInvalidDataType = 0x8D, CHIPErrorCodeUnsupportedCluster = 0xC3, }; diff --git a/src/darwin/Framework/CHIP/CHIPError.mm b/src/darwin/Framework/CHIP/CHIPError.mm index 776acdfe61ee5d..a39046d4173a6a 100644 --- a/src/darwin/Framework/CHIP/CHIPError.mm +++ b/src/darwin/Framework/CHIP/CHIPError.mm @@ -128,6 +128,10 @@ + (NSError *)errorForZCLErrorCode:(uint8_t)errorCode errorWithDomain:CHIPErrorDomain code:CHIPErrorCodeUnsupportedWrite userInfo:@{ NSLocalizedDescriptionKey : NSLocalizedString(@"Attempt to write read-only attribute.", nil) }]; + case EMBER_ZCL_STATUS_NOT_FOUND: + return [NSError errorWithDomain:CHIPErrorDomain + code:CHIPErrorCodeNotFound + userInfo:@{ NSLocalizedDescriptionKey : NSLocalizedString(@"Data not found.", nil) }]; case EMBER_ZCL_STATUS_INVALID_DATA_TYPE: return [NSError errorWithDomain:CHIPErrorDomain @@ -207,6 +211,10 @@ + (uint8_t)errorToZCLErrorCode:(NSError * _Nullable)error return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; case CHIPErrorCodeUnsupportedWrite: return EMBER_ZCL_STATUS_UNSUPPORTED_WRITE; + case CHIPErrorCodeNotFound: + return EMBER_ZCL_STATUS_NOT_FOUND; + case CHIPErrorCodeInvalidDataType: + return EMBER_ZCL_STATUS_INVALID_DATA_TYPE; case CHIPErrorCodeUnsupportedCluster: return EMBER_ZCL_STATUS_UNSUPPORTED_CLUSTER; default: diff --git a/src/darwin/Framework/CHIPTests/CHIPErrorTestUtils.mm b/src/darwin/Framework/CHIPTests/CHIPErrorTestUtils.mm index a1674fcfc13810..eb78a6146016cc 100644 --- a/src/darwin/Framework/CHIPTests/CHIPErrorTestUtils.mm +++ b/src/darwin/Framework/CHIPTests/CHIPErrorTestUtils.mm @@ -52,6 +52,8 @@ + (uint8_t)errorToZCLErrorCode:(NSError * _Nullable)error return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; case CHIPErrorCodeUnsupportedWrite: return EMBER_ZCL_STATUS_UNSUPPORTED_WRITE; + case CHIPErrorCodeNotFound: + return EMBER_ZCL_STATUS_NOT_FOUND; case CHIPErrorCodeInvalidDataType: return EMBER_ZCL_STATUS_INVALID_DATA_TYPE; case CHIPErrorCodeUnsupportedCluster: