@@ -62,13 +62,12 @@ CHIP_ERROR LogProvider::GetLogForIntent(IntentEnum intent, MutableByteSpan & out
62
62
VerifyOrReturnError (CHIP_NO_ERROR == err, err, outBuffer.reduce_size (0 ));
63
63
64
64
bool unusedOutIsEndOfLog;
65
- err = CollectLog (sessionHandle, outBuffer, unusedOutIsEndOfLog);
66
- VerifyOrReturnError (CHIP_NO_ERROR == err, err , outBuffer.reduce_size (0 ));
65
+ CHIP_ERROR collectErr = CollectLog (sessionHandle, outBuffer, unusedOutIsEndOfLog);
66
+ VerifyOrDo (collectErr == CHIP_NO_ERROR , outBuffer.reduce_size (0 ));
67
67
68
- err = EndLogCollection (sessionHandle, err);
69
- VerifyOrReturnError (CHIP_NO_ERROR == err, err, outBuffer.reduce_size (0 ));
68
+ CHIP_ERROR endErr = EndLogCollection (sessionHandle, collectErr);
70
69
71
- return CHIP_NO_ERROR;
70
+ return (collectErr != CHIP_NO_ERROR) ? collectErr : endErr ;
72
71
}
73
72
74
73
size_t LogProvider::GetSizeForIntent (IntentEnum intent)
@@ -293,7 +292,7 @@ CHIP_ERROR LogProvider::EndLogCollection(LogSessionHandle sessionHandle, CHIP_ER
293
292
Platform::MemoryFree (context);
294
293
mSessionContextMap .erase (sessionHandle);
295
294
296
- return error ;
295
+ return CHIP_NO_ERROR ;
297
296
}
298
297
299
298
CHIP_ERROR LogProvider::CollectLog (LogSessionHandle sessionHandle, MutableByteSpan & outBuffer, bool & outIsEndOfLog)
0 commit comments