diff --git a/Algorithms/StronglyConnectedComponents.h b/Algorithms/StronglyConnectedComponents.h index b7d288714..264e41b33 100644 --- a/Algorithms/StronglyConnectedComponents.h +++ b/Algorithms/StronglyConnectedComponents.h @@ -350,9 +350,10 @@ public: OGRFeature *poFeature; poFeature = OGRFeature::CreateFeature( poLayer->GetLayerDefn() ); poFeature->SetGeometry( &lineString ); - if( poLayer->CreateFeature( poFeature ) != OGRERR_NONE ) - { - ERR( "Failed to create feature in shapefile.\n" ); + if( poLayer->CreateFeature( poFeature ) != OGRERR_NONE ) { + throw OSRMException( + "Failed to create feature in shapefile." + ); } OGRFeature::DestroyFeature( poFeature ); } diff --git a/Tools/componentAnalysis.cpp b/Tools/componentAnalysis.cpp index 664c58954..af9e76c75 100644 --- a/Tools/componentAnalysis.cpp +++ b/Tools/componentAnalysis.cpp @@ -28,6 +28,7 @@ or see http://www.gnu.org/licenses/agpl.txt. #include "../Util/BaseConfiguration.h" #include "../Util/InputFileUtil.h" #include "../Util/GraphLoader.h" +#include "../Util/OSRMException.h" #include #include @@ -48,13 +49,14 @@ std::vector traffic_light_node_IDs_vector; int main (int argument_count, char *argument_values[]) { if(argument_count < 3) { - ERR("usage:\n" << argument_values[0] << " "); + std::cerr << "usage:\n" << argument_values[0] << " " << std::endl; + return -1; } INFO("Using restrictions from file: " << argument_values[2]); std::ifstream restriction_ifstream(argument_values[2], std::ios::binary); if(!restriction_ifstream.good()) { - ERR("Could not access files"); + throw OSRMException("Could not access files"); } uint32_t usable_restriction_count = 0; restriction_ifstream.read( @@ -76,7 +78,7 @@ int main (int argument_count, char *argument_values[]) { ); if (!input_stream.is_open()) { - ERR("Cannot open " << argument_values[1]); + throw OSRMException("Cannot open osrm file"); } std::vector edge_list;