The GitHub Actions job "pre-commit" on iceberg-cpp.git/bugfixes_new_2 has 
succeeded.
Run started by GitHub user shangxinli (triggered by shangxinli).

Head commit for run:
7071acb84254590f348f8592840934134847e425 / Xinli Shang <[email protected]>
fix: properly propagate errors in MetricsConfig validation

The previous code had a logic error when checking the result of
FindFieldByName(). It used:
  if (!field.has_value() || !field.value().has_value())

This was incorrect because:
1. If FindFieldByName() returns an error (Result contains an error),
   field.has_value() would be false, but the error was not propagated
2. field.value() returns std::optional<std::reference_wrapper<...>>,
   so the second check was redundant and confusing

Fixed by using ICEBERG_ASSIGN_OR_RAISE to properly propagate any
errors from FindFieldByName(), then checking if the returned optional
contains a value. This matches the pattern used throughout the rest
of the codebase and ensures errors are properly handled.

Report URL: https://github.com/apache/iceberg-cpp/actions/runs/20602669997

With regards,
GitHub Actions via GitBox

Reply via email to