diff --git a/src/app/reporting/Engine.cpp b/src/app/reporting/Engine.cpp index 91e1e1f52891ec..37c7e31dd645fb 100644 --- a/src/app/reporting/Engine.cpp +++ b/src/app/reporting/Engine.cpp @@ -204,16 +204,16 @@ CHIP_ERROR Engine::BuildSingleReportDataAttributeReportIBs(ReportDataMessage::Bu pathForRetrieval, &encodeState); if (err != CHIP_NO_ERROR) { - ChipLogError(DataManagement, - "Error retrieving data from clusterId: " ChipLogFormatMEI ", err = %" CHIP_ERROR_FORMAT, - ChipLogValueMEI(pathForRetrieval.mClusterId), err.Format()); - // If error is not an "out of writer space" error, rollback and encode status. // Otherwise, if partial data allowed, save the encode state. // Otherwise roll back. If we have already encoded some chunks, we are done; otherwise encode status. if (encodeState.AllowPartialData() && IsOutOfWriterSpaceError(err)) { + ChipLogDetail(DataManagement, + "List does not fit in packet, chunk between list items for clusterId: " ChipLogFormatMEI + ", attributeId: " ChipLogFormatMEI, + ChipLogValueMEI(pathForRetrieval.mClusterId), ChipLogValueMEI(pathForRetrieval.mAttributeId)); // Encoding is aborted but partial data is allowed, then we don't rollback and save the state for next chunk. // The expectation is that RetrieveClusterData has already reset attributeReportIBs to a good state (rolled // back any partially-written AttributeReportIB instances, reset its error status). Since AllowPartialData() @@ -230,6 +230,11 @@ CHIP_ERROR Engine::BuildSingleReportDataAttributeReportIBs(ReportDataMessage::Bu if (!IsOutOfWriterSpaceError(err)) { + ChipLogError(DataManagement, + "Fail to retrieve data, roll back and encode status on clusterId: " ChipLogFormatMEI + ", attributeId: " ChipLogFormatMEI "err = %" CHIP_ERROR_FORMAT, + ChipLogValueMEI(pathForRetrieval.mClusterId), ChipLogValueMEI(pathForRetrieval.mAttributeId), + err.Format()); // Try to encode our error as a status response. err = attributeReportIBs.EncodeAttributeStatus(pathForRetrieval, StatusIB(err)); if (err != CHIP_NO_ERROR) @@ -239,6 +244,14 @@ CHIP_ERROR Engine::BuildSingleReportDataAttributeReportIBs(ReportDataMessage::Bu attributeReportIBs.Rollback(attributeBackup); } } + else + { + ChipLogDetail(DataManagement, + "Next attribute value does not fit in packet, roll back on clusterId: " ChipLogFormatMEI + ", attributeId: " ChipLogFormatMEI ", err = %" CHIP_ERROR_FORMAT, + ChipLogValueMEI(pathForRetrieval.mClusterId), ChipLogValueMEI(pathForRetrieval.mAttributeId), + err.Format()); + } } } SuccessOrExit(err);