mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
HDF : Create ESmry reader in try catch block
This commit is contained in:
parent
7f35fb23c4
commit
30687e18bc
@ -18,6 +18,8 @@
|
||||
|
||||
#include "RifHdf5SummaryExporter.h"
|
||||
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "RifHdf5Exporter.h"
|
||||
#include "RifSummaryReaderInterface.h"
|
||||
|
||||
@ -38,6 +40,8 @@ bool RifHdf5SummaryExporter::ensureHdf5FileIsCreated( const std::string& smspecF
|
||||
|
||||
// TODO: Use time stamp of file to make sure the smspec file is older than the h5 file
|
||||
if ( !QFile::exists( QString::fromStdString( h5FileName ) ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
Opm::EclIO::ESmry sourceSummaryData( smspecFileName );
|
||||
|
||||
@ -50,6 +54,16 @@ bool RifHdf5SummaryExporter::ensureHdf5FileIsCreated( const std::string& smspecF
|
||||
writeGeneralSection( exporter, sourceSummaryData );
|
||||
writeSummaryVectors( exporter, sourceSummaryData );
|
||||
}
|
||||
catch ( std::exception& e )
|
||||
{
|
||||
QString txt =
|
||||
QString( "HDF export to file %1 failed : %3" ).arg( QString::fromStdString( smspecFileName ), e.what() );
|
||||
|
||||
RiaLogging::error( txt );
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user