mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-10-12 17:02:02 -05:00
Guard against non-existing file
This commit is contained in:
1 parent
1bde4f4a22
commit
4c4b5233c0
1 file changed
+3
@@ -87,6 +87,9 @@ namespace Opm
|
||||
HardcodedTimeStepControl( const std::string& filename)
|
||||
{
|
||||
std::ifstream infile (filename);
|
||||
if (!infile.is_open()) {
|
||||
OPM_THROW(std::runtime_error,"Incorrect or no filename is provided to the hardcodedTimeStep. Use timestep.control.filename=your_file_name");
|
||||
}
|
||||
std::string::size_type sz;
|
||||
std::string line;
|
||||
while ( std::getline(infile, line)) {
|
||||
|
||||
Reference in new issue
Block a user