Remove generic std::exception handlers, they don't seem to be adding value, and they hide useful info.
This commit is contained in:
committed by
Patrick Niklaus
parent
b4710633b1
commit
0b868969be
@@ -140,28 +140,21 @@ void ExtractionContainers::PrepareData(ScriptingEnvironment &scripting_environme
|
||||
const std::string &name_file_name,
|
||||
const std::string &turn_lane_file_name)
|
||||
{
|
||||
try
|
||||
{
|
||||
std::ofstream file_out_stream;
|
||||
file_out_stream.open(output_file_name.c_str(), std::ios::binary);
|
||||
const util::FingerPrint fingerprint = util::FingerPrint::GetValid();
|
||||
file_out_stream.write((char *)&fingerprint, sizeof(util::FingerPrint));
|
||||
std::ofstream file_out_stream;
|
||||
file_out_stream.open(output_file_name.c_str(), std::ios::binary);
|
||||
const util::FingerPrint fingerprint = util::FingerPrint::GetValid();
|
||||
file_out_stream.write((char *)&fingerprint, sizeof(util::FingerPrint));
|
||||
|
||||
PrepareNodes();
|
||||
WriteNodes(file_out_stream);
|
||||
PrepareEdges(scripting_environment);
|
||||
WriteEdges(file_out_stream);
|
||||
PrepareNodes();
|
||||
WriteNodes(file_out_stream);
|
||||
PrepareEdges(scripting_environment);
|
||||
WriteEdges(file_out_stream);
|
||||
|
||||
PrepareRestrictions();
|
||||
WriteRestrictions(restrictions_file_name);
|
||||
PrepareRestrictions();
|
||||
WriteRestrictions(restrictions_file_name);
|
||||
|
||||
WriteCharData(name_file_name);
|
||||
WriteTurnLaneMasks(turn_lane_file_name, turn_lane_offsets, turn_lane_masks);
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
std::cerr << "Caught Execption:" << e.what() << std::endl;
|
||||
}
|
||||
WriteCharData(name_file_name);
|
||||
WriteTurnLaneMasks(turn_lane_file_name, turn_lane_offsets, turn_lane_masks);
|
||||
}
|
||||
|
||||
void ExtractionContainers::WriteTurnLaneMasks(
|
||||
|
||||
@@ -73,7 +73,6 @@ namespace extractor
|
||||
*/
|
||||
int Extractor::run(ScriptingEnvironment &scripting_environment)
|
||||
{
|
||||
try
|
||||
{
|
||||
util::LogPolicy::GetInstance().Unmute();
|
||||
TIMER_START(extracting);
|
||||
@@ -202,14 +201,7 @@ int Extractor::run(ScriptingEnvironment &scripting_environment)
|
||||
util::SimpleLogger().Write() << "extraction finished after " << TIMER_SEC(extracting)
|
||||
<< "s";
|
||||
}
|
||||
// we do this for scoping
|
||||
// TODO move to own functions
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
util::SimpleLogger().Write(logWARNING) << e.what();
|
||||
return 1;
|
||||
}
|
||||
try
|
||||
|
||||
{
|
||||
// Transform the node-based graph that OSM is based on into an edge-based graph
|
||||
// that is better for routing. Every edge becomes a node, and every valid
|
||||
@@ -266,11 +258,6 @@ int Extractor::run(ScriptingEnvironment &scripting_environment)
|
||||
util::SimpleLogger().Write() << "To prepare the data for routing, run: "
|
||||
<< "./osrm-contract " << config.output_file_name << std::endl;
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
util::SimpleLogger().Write(logWARNING) << e.what();
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user