+ throw image_reader_exception if we can't read tiff file

+ catch image_reader_exceptions in raster.input
+ re-throw in bind()
This commit is contained in:
Artem Pavlenko 2011-04-11 21:17:10 +00:00
parent c906dcea02
commit 7191d56a16
3 changed files with 15 additions and 5 deletions

View file

@ -111,9 +111,15 @@ void raster_datasource::bind() const
#endif
}
}
catch (mapnik::image_reader_exception const& ex)
{
std::cerr << "Raster Plugin: image reader exception caught:" << ex.what() << std::endl;
throw;
}
catch (...)
{
std::cerr << "Raster Plugin: exception caught" << std::endl;
throw;
}
is_bound_ = true;

View file

@ -102,6 +102,10 @@ feature_ptr raster_featureset<LookupPolicy>::next()
}
}
}
catch (mapnik::image_reader_exception const& ex)
{
std::cerr << "Raster Plugin: image reader exception caught:" << ex.what() << std::endl;
}
catch (...)
{
std::cerr << "Raster Plugin: exception caught" << std::endl;

View file

@ -97,7 +97,7 @@ void tiff_reader::init()
// TODO: error handling
TIFFSetWarningHandler(0);
TIFF* tif = load_if_exists(file_name_);
if (!tif) return;
if (!tif) throw image_reader_exception ("Can't load tiff file");
char msg[1024];