throw error when input file cannot be opened

This commit is contained in:
Maximilian Keßler 2023-11-04 19:06:12 +01:00
parent 46263b01a7
commit daaee30be8
Signed by: max
GPG key ID: BCC5A619923C0BA5

View file

@ -13,6 +13,9 @@ int main(int argc, char** argv)
}
std::fstream input_file_graph{argv[1]};
if (not input_file_graph.is_open()) {
throw std::runtime_error(std::string("Could not open file for reading: ") + argv[1]);
}
ED::Graph const graph = ED::Graph::read_dimacs(input_file_graph);
ED::Graph greedy_matching_as_graph{graph.num_nodes()};