Skip to content

Commit

Permalink
Fix compile without error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 committed Jun 10, 2024
1 parent b52b362 commit 41012d9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app/codegen-interaction-model/CodegenDataModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ InteractionModel::ClusterEntry FirstServerClusterEntry(EndpointId endpointId, co
return *entryValue;
}

#if CHIP_ERROR_LOGGING
if (CHIP_ERROR * errValue = std::get_if<CHIP_ERROR>(&entry))
{
ChipLogError(AppServer, "Failed to load cluster entry: %" CHIP_ERROR_FORMAT, errValue->Format());
Expand All @@ -101,6 +102,7 @@ InteractionModel::ClusterEntry FirstServerClusterEntry(EndpointId endpointId, co
// Should NOT be possible: entryFrom has only 2 variants
ChipLogError(AppServer, "Failed to load cluster entry, UNKNOWN entry return type");
}
#endif
}

return InteractionModel::ClusterEntry::kInvalid;
Expand Down Expand Up @@ -381,7 +383,11 @@ std::optional<InteractionModel::ClusterInfo> CodegenDataModel::GetClusterInfo(co

if (CHIP_ERROR * err = std::get_if<CHIP_ERROR>(&info))
{
#if CHIP_ERROR_LOGGING
ChipLogError(AppServer, "Failed to load cluster info: %" CHIP_ERROR_FORMAT, err->Format());
#else
(void)err->Format();
#endif
return std::nullopt;
}

Expand Down

0 comments on commit 41012d9

Please sign in to comment.