From 6ae559b42b65343bdbe3124a81e28d2af5534d71 Mon Sep 17 00:00:00 2001 From: "Daniel J. Hofmann" Date: Mon, 16 May 2016 14:20:43 -0400 Subject: [PATCH] Throw error if edge based graph file could not be loaded --- src/contractor/contractor.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/contractor/contractor.cpp b/src/contractor/contractor.cpp index 742c56106..9360946cd 100644 --- a/src/contractor/contractor.cpp +++ b/src/contractor/contractor.cpp @@ -152,6 +152,8 @@ std::size_t Contractor::LoadEdgeExpandedGraph( { util::SimpleLogger().Write() << "Opening " << edge_based_graph_filename; boost::filesystem::ifstream input_stream(edge_based_graph_filename, std::ios::binary); + if (!input_stream) + throw util::exception("Could not load edge based graph file"); const bool update_edge_weights = !segment_speed_filenames.empty(); const bool update_turn_penalties = !turn_penalty_filenames.empty();