diff --git a/ApplicationLibCode/FileInterface/RifReaderOpmRft.cpp b/ApplicationLibCode/FileInterface/RifReaderOpmRft.cpp index b73840b077..81db96f123 100644 --- a/ApplicationLibCode/FileInterface/RifReaderOpmRft.cpp +++ b/ApplicationLibCode/FileInterface/RifReaderOpmRft.cpp @@ -42,6 +42,10 @@ RifReaderOpmRft::RifReaderOpmRft( const QString& fileName ) buildMetaData(); } + catch ( const std::exception& e ) + { + RiaLogging::error( QString( "Failed to open RFT file %1\n%2" ).arg( fileName ).arg( e.what() ) ); + } catch ( ... ) { RiaLogging::error( QString( "Failed to open RFT file %1" ).arg( fileName ) ); @@ -445,9 +449,16 @@ void RifReaderOpmRft::importWellNames() std::vector RifReaderOpmRft::importWellData( const std::string& wellName, const std::string& propertyName, const RftDate& date ) const { - if ( m_opm_rft->hasArray( propertyName, wellName, date ) ) + try + { + // THe hasArray method can throw, so we must use a try/catch block here + if ( m_opm_rft->hasArray( propertyName, wellName, date ) ) + { + return m_opm_rft->getRft( propertyName, wellName, date ); + } + } + catch ( ... ) { - return m_opm_rft->getRft( propertyName, wellName, date ); } return {};