Skip to content
Snippets Groups Projects
Commit 7e7d8d52 authored by Franck Dary's avatar Franck Dary
Browse files

Throwing exception when rm file not found

parent 2ac42b6d
No related branches found
No related tags found
No related merge requests found
...@@ -21,6 +21,8 @@ ReadingMachine::ReadingMachine(std::filesystem::path path, std::vector<std::file ...@@ -21,6 +21,8 @@ ReadingMachine::ReadingMachine(std::filesystem::path path, std::vector<std::file
void ReadingMachine::readFromFile(std::filesystem::path path) void ReadingMachine::readFromFile(std::filesystem::path path)
{ {
std::FILE * file = std::fopen(path.c_str(), "r"); std::FILE * file = std::fopen(path.c_str(), "r");
if (not file)
util::myThrow(fmt::format("can't open file '{}'", path.string()));
char buffer[1024]; char buffer[1024];
std::string fileContent; std::string fileContent;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment