From 311a044f13784b4a95b47e5c5e50b6a432b15aba Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 7 Mar 2025 17:16:30 -0500 Subject: [PATCH] Fix error handling in XPC version of invokeCommands. Two issues: 1. If we got an error we did not log it. 2. If we got an error we did not actually propagate it out to the API consumer. --- src/darwin/Framework/CHIP/MTRDevice_XPC.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm index eee061cfbf73eb..b144e79b3f647b 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm @@ -552,7 +552,11 @@ - (void)invokeCommands:(NSArray *> *)c return; } - completion(responses, nil); + if (error != nil) { + MTR_LOG_ERROR("%@ got error trying to invokeCommands: %@", self, error); + } + + completion(responses, error); }); }]; } @catch (NSException * exception) {