throw error when input file cannot be opened
This commit is contained in:
parent
46263b01a7
commit
daaee30be8
1 changed files with 3 additions and 0 deletions
|
@ -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()};
|
||||
|
|
Loading…
Reference in a new issue