Skip to content

Commit 652f786

Browse files
Fix error handling in XPC version of invokeCommands. (#37934)
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.
1 parent 8b2cf2f commit 652f786

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/darwin/Framework/CHIP/MTRDevice_XPC.mm

+5-1
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,11 @@ - (void)invokeCommands:(NSArray<NSArray<MTRCommandWithRequiredResponse *> *> *)c
552552
return;
553553
}
554554

555-
completion(responses, nil);
555+
if (error != nil) {
556+
MTR_LOG_ERROR("%@ got error trying to invokeCommands: %@", self, error);
557+
}
558+
559+
completion(responses, error);
556560
});
557561
}];
558562
} @catch (NSException * exception) {

0 commit comments

Comments
 (0)