mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-12 16:32:12 -05:00
libecl : Handle exceptions in try/catch block
This commit is contained in:
1 parent
6b4d80d116
commit
f6b956a9da
1 file changed
+10
-1
@@ -108,12 +108,21 @@ ecl_sum_type* openEclSum( const QString& inHeaderFileName, bool includeRestartFi
|
|||||||
|
|
||||||
bool lazyLoad = true;
|
bool lazyLoad = true;
|
||||||
std::string itemSeparatorInVariableNames = ":";
|
std::string itemSeparatorInVariableNames = ":";
|
||||||
ecl_sum_type* ecl_sum = ecl_sum_fread_alloc( RiaStringEncodingTools::toNativeEncoded( headerFileName ).data(),
|
|
||||||
|
ecl_sum_type* ecl_sum = nullptr;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ecl_sum = ecl_sum_fread_alloc( RiaStringEncodingTools::toNativeEncoded( headerFileName ).data(),
|
||||||
dataFiles,
|
dataFiles,
|
||||||
itemSeparatorInVariableNames.data(),
|
itemSeparatorInVariableNames.data(),
|
||||||
includeRestartFiles,
|
includeRestartFiles,
|
||||||
lazyLoad,
|
lazyLoad,
|
||||||
ECL_FILE_CLOSE_STREAM );
|
ECL_FILE_CLOSE_STREAM );
|
||||||
|
}
|
||||||
|
catch ( ... )
|
||||||
|
{
|
||||||
|
ecl_sum = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
stringlist_free( dataFiles );
|
stringlist_free( dataFiles );
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user