Skip to content

Commit e2cf82f

Browse files
authored
fix: properly propagate errors in MetricsConfig validation (#465)
1 parent d645802 commit e2cf82f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/iceberg/metrics_config.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ Status MetricsConfig::VerifyReferencedColumns(
3636
}
3737
auto field_name =
3838
std::string_view(key).substr(TableProperties::kMetricModeColumnConfPrefix.size());
39-
auto field = schema.FindFieldByName(field_name);
40-
if (!field.has_value() || !field.value().has_value()) {
39+
ICEBERG_ASSIGN_OR_RAISE(auto field, schema.FindFieldByName(field_name));
40+
if (!field.has_value()) {
4141
return ValidationFailed(
4242
"Invalid metrics config, could not find column {} from table prop {} in "
4343
"schema {}",

0 commit comments

Comments
 (0)