Make most command-line tools return useful error codes on well-known exceptions.

This commit is contained in:
Daniel Patterson
2017-05-26 21:16:20 -07:00
committed by Patrick Niklaus
parent 03e83ec6a0
commit 3d77714c36
18 changed files with 229 additions and 39 deletions
+2 -1
View File
@@ -108,7 +108,8 @@ int SourceContainer::LoadRasterSource(const std::string &path_string,
boost::filesystem::path filepath(path_string);
if (!boost::filesystem::exists(filepath))
{
throw util::exception(path_string + " does not exist" + SOURCE_REF);
throw util::RuntimeError(
path_string, ErrorCode::FileOpenError, SOURCE_REF, "File not found");
}
RasterGrid rasterData{filepath, ncols, nrows};