Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return valid code MTRError when commissioning is attempted with duplicate NOC #22214

Closed
skothawade-apple opened this issue Aug 27, 2022 · 2 comments · Fixed by #22271
Closed

Comments

@skothawade-apple
Copy link

Problem

MTRError doesn't define code for duplicate fabric, therefore clients receive MTRError with default code 1. Here is how error message looks like-

Error Domain=MTRErrorDomain Code=1 "Undefined error:126." UserInfo={underlyingError=<MTRErrorHolder: 0x106223f20>, NSLocalizedDescription=Undefined error:126., errorCode=126}

Proposed Solution

We should define a new MTRError code and return that instead of above

@aajain-com
Copy link
Contributor

This is needed so we can gracefully handle cases where the accessory is already added to the fabric previously.

@bzbarsky-apple
Copy link
Contributor

Note to self: that's CHIP_ERROR_FABRIC_EXISTS.

bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue Aug 30, 2022
This allows detection of this case without having to examine the
"underlyingError" of the NSError's userInfo.

Fixes project-chip#22214
andy31415 pushed a commit that referenced this issue Aug 31, 2022
)

This allows detection of this case without having to examine the
"underlyingError" of the NSError's userInfo.

Fixes #22214
isiu-apple pushed a commit to isiu-apple/connectedhomeip that referenced this issue Sep 16, 2022
…ject-chip#22271)

This allows detection of this case without having to examine the
"underlyingError" of the NSError's userInfo.

Fixes project-chip#22214
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants