Skip to content

Commit f574fa5

Browse files
authored
[Darwin] Return an error if the log target for downloadLogOfType does not exists on the device (#35819)
1 parent fe2f49f commit f574fa5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/darwin/Framework/CHIP/MTRDiagnosticLogsDownloader.mm

+2-1
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,11 @@ - (void)checkInteractionModelResponse:(MTRDiagnosticLogsClusterRetrieveLogsRespo
195195

196196
VerifyOrReturn(![status isEqual:@(MTRDiagnosticLogsStatusBusy)], [self failure:[MTRError errorForCHIPErrorCode:CHIP_ERROR_BUSY]]);
197197
VerifyOrReturn(![status isEqual:@(MTRDiagnosticLogsStatusDenied)], [self failure:[MTRError errorForCHIPErrorCode:CHIP_ERROR_ACCESS_DENIED]]);
198+
VerifyOrReturn(![status isEqual:@(MTRDiagnosticLogsStatusNoLogs)], [self failure:[MTRError errorForCHIPErrorCode:CHIP_ERROR_NOT_FOUND]]);
198199

199200
// If the whole log content fits into the response LogContent field or if there is no log, forward it to the caller
200201
// and stop here.
201-
if ([status isEqual:@(MTRDiagnosticLogsStatusExhausted)] || [status isEqual:@(MTRDiagnosticLogsStatusNoLogs)]) {
202+
if ([status isEqual:@(MTRDiagnosticLogsStatusExhausted)]) {
202203
NSError * writeError = nil;
203204
[self writeToFile:response.logContent error:&writeError];
204205
VerifyOrReturn(nil == writeError, [self failure:writeError]);

0 commit comments

Comments
 (0)