Throw an exception in filefuncs.cpp when a file is not found
This commit is contained in:
parent
43b4629a6d
commit
c7981b9948
@ -9,10 +9,7 @@ string getFileContent(const string& file)
|
||||
fileStream.open(file, ios::in);
|
||||
if (fileStream.is_open()) while (getline(fileStream, lineinput)) {
|
||||
fullinput.append(lineinput + "\n");
|
||||
} else {
|
||||
cout << "Could not open \"" << file << "\"." << endl;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
} else throw Yerbacon::Exception("Could not open \"" + file + "\".");
|
||||
fileStream.close();
|
||||
return fullinput;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user