Skip to content
Snippets Groups Projects
Commit 7f307a52 authored by Oliver Sander's avatar Oliver Sander
Browse files

throw exception if the file couldn't be opened

[[Imported from SVN: r2259]]
parent e27a1b15
No related branches found
No related tags found
No related merge requests found
......@@ -5,8 +5,8 @@
#include <string>
#include <sstream>
#include <fstream>
#include <assert.h>
#include <dune/common/exceptions.hh>
using namespace Dune;
using namespace std;
......@@ -17,7 +17,9 @@ ConfigParser::ConfigParser()
void ConfigParser::parseFile(string file)
{
ifstream in(file.c_str());
assert(in);
if (!in)
DUNE_THROW(IOError, "Could open configuration file " << file);
string prefix;
while(!in.eof())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment