mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-13 17:02:13 -05:00
Add more details to error messages during parsing of input files
This commit is contained in:
1 parent
c685cff654
commit
b0e0bc5f14
1 file changed
+33
@@ -25,6 +25,7 @@
|
|||||||
#include "cafPdmUiItem.h"
|
#include "cafPdmUiItem.h"
|
||||||
#include "cafUtils.h"
|
#include "cafUtils.h"
|
||||||
|
|
||||||
|
#include "opm/common/utility/OpmInputError.hpp"
|
||||||
#include "opm/input/eclipse/Deck/Deck.hpp"
|
#include "opm/input/eclipse/Deck/Deck.hpp"
|
||||||
#include "opm/input/eclipse/Parser/ParseContext.hpp"
|
#include "opm/input/eclipse/Parser/ParseContext.hpp"
|
||||||
#include "opm/input/eclipse/Parser/Parser.hpp"
|
#include "opm/input/eclipse/Parser/Parser.hpp"
|
||||||
@@ -109,8 +110,20 @@ std::vector<Opm::VFPInjTable> extractVfpInjectionTables( const std::string& file
|
|||||||
tables.push_back( table );
|
tables.push_back( table );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch ( Opm::OpmInputError& e )
|
||||||
|
{
|
||||||
|
QString text = QString( "Error detected when parsing '%1'. Imported data might be missing or incomplete.\n%2" )
|
||||||
|
.arg( QString::fromStdString( filename ) )
|
||||||
|
.arg( QString::fromStdString( e.what() ) );
|
||||||
|
|
||||||
|
RiaLogging::warning( text );
|
||||||
|
}
|
||||||
catch ( ... )
|
catch ( ... )
|
||||||
{
|
{
|
||||||
|
QString text =
|
||||||
|
QString( "Error detected when parsing '%1'. Imported data might be missing or incomplete." ).arg( QString::fromStdString( filename ) );
|
||||||
|
|
||||||
|
RiaLogging::warning( text );
|
||||||
}
|
}
|
||||||
|
|
||||||
return tables;
|
return tables;
|
||||||
@@ -140,8 +153,20 @@ std::vector<Opm::VFPProdTable> extractVfpProductionTables( const std::string& fi
|
|||||||
tables.push_back( table );
|
tables.push_back( table );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch ( Opm::OpmInputError& e )
|
||||||
|
{
|
||||||
|
QString text = QString( "Error detected when parsing '%1'. Imported data might be missing or incomplete.\n%2" )
|
||||||
|
.arg( QString::fromStdString( filename ) )
|
||||||
|
.arg( QString::fromStdString( e.what() ) );
|
||||||
|
|
||||||
|
RiaLogging::warning( text );
|
||||||
|
}
|
||||||
catch ( ... )
|
catch ( ... )
|
||||||
{
|
{
|
||||||
|
QString text =
|
||||||
|
QString( "Error detected when parsing '%1'. Imported data might be missing or incomplete." ).arg( QString::fromStdString( filename ) );
|
||||||
|
|
||||||
|
RiaLogging::warning( text );
|
||||||
}
|
}
|
||||||
|
|
||||||
return tables;
|
return tables;
|
||||||
@@ -194,6 +219,14 @@ std::pair<std::vector<Opm::VFPProdTable>, std::vector<Opm::VFPInjTable>> extract
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch ( Opm::OpmInputError& e )
|
||||||
|
{
|
||||||
|
QString text = QString( "Error detected when parsing '%1'. Imported data might be missing or incomplete.\n%2" )
|
||||||
|
.arg( QString::fromStdString( dataDeckFilename ) )
|
||||||
|
.arg( QString::fromStdString( e.what() ) );
|
||||||
|
|
||||||
|
RiaLogging::warning( text );
|
||||||
|
}
|
||||||
catch ( ... )
|
catch ( ... )
|
||||||
{
|
{
|
||||||
QString text = QString( "Error detected when parsing '%1'. Imported data might be missing or incomplete." )
|
QString text = QString( "Error detected when parsing '%1'. Imported data might be missing or incomplete." )
|
||||||
|
|||||||
Reference in new issue
Block a user