Throw an exception in filefuncs.cpp when a file is not found

This commit is contained in:
Username404 2021-09-26 12:42:01 +02:00
parent 43b4629a6d
commit c7981b9948
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1

View File

@ -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;
}