return EXIT_FAILURE on invalid input ref #3410

This commit is contained in:
artemp 2016-04-25 10:11:55 +02:00
parent ed87cd2883
commit 1871e5f62d

View file

@ -180,7 +180,11 @@ int main (int argc, char** argv)
{
std::clog << "processing '" << filename << "' as CSV\n";
auto result = mapnik::detail::process_csv_file(boxes, filename, manual_headers, separator, quote);
if (!result.first) continue;
if (!result.first)
{
std::clog << "Error: failed to process " << filename << std::endl;
return EXIT_FAILURE;
}
extent = result.second;
}
else if (mapnik::detail::is_geojson(filename))
@ -190,7 +194,7 @@ int main (int argc, char** argv)
if (!result.first)
{
std::clog << "Error: failed to process " << filename << std::endl;
continue;
return EXIT_FAILURE;
}
extent = result.second;
}
@ -224,6 +228,11 @@ int main (int argc, char** argv)
file.close();
}
}
else
{
std::clog << "Invalid extent " << extent << std::endl;
return EXIT_FAILURE;
}
}
std::clog << "done!" << std::endl;
return EXIT_SUCCESS;