#14636 Orion Events: List COMMENT as valid item name

COMMENT is accepted on all keywords and is stored on the event instead of
being passed as keyword data, so it is not part of the item names reported
by opm-common. The validation error listed only the opm-common items, giving
no hint that COMMENT is allowed when a user mistyped it as COMMENTS.

Append COMMENT to the list of valid item names in the error message. Only the
diagnostic is affected, COMMENT is still handled as event metadata.
This commit is contained in:
Kristian Bendiksen authored and Magne Sjaastad committed 2026-09-01 11:56:59 +02:00
1 parent 1336eba81d
commit 98e39bc02f
2 files changed
+49

No files matched your search

@@ -74,6 +74,12 @@ std::expected<void, QString> validateKeywordItems( const QString& keywordName, c
validNames.push_back( itemName );
}
// COMMENT is accepted on all keywords. It is stored on the event and emitted as a schedule comment instead of being
// passed as keyword data, so it is not part of the item names reported by opm-common. Include it in the list of
// valid names to help spot typos like COMMENTS.
const QString commentItemName( "COMMENT" );
if ( !validNames.contains( commentItemName ) ) validNames.push_back( commentItemName );
return std::unexpected( QString( "Keyword '%1' contains invalid item names: %2. Valid item names are: %3." )
.arg( keywordName.toUpper(), invalidNames.join( ", " ), validNames.join( ", " ) ) );
}