Log error when a result fails to load

findOrLoadKnownScalarResultForTimeStep asserted when the reader failed to
load a result. A result listed in the meta data that cannot be read from
file is a run-time condition, not a programming error, and aborted the
application in builds with asserts enabled.

Report the failing result name and time step through RiaLogging instead.
This commit is contained in:
Magne Sjaastad
2026-08-19 07:26:27 +02:00
parent 71090bdc18
commit 5b62a84a12
@@ -1809,8 +1809,9 @@ size_t RigCaseCellResultsData::findOrLoadKnownScalarResultForTimeStep( const Rig
if ( !resultLoadingSuccess )
{
// Error logging
CAF_ASSERT( false );
// A result present in the meta data can still fail to load from file. This is a run-time condition, not a
// programming error, so report it instead of asserting.
RiaLogging::error( QString( "Failed to load result '%1' for time step %2" ).arg( resultName ).arg( timeStepIndex ).toStdString() );
}
}