+ 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:
parent
c906dcea02
commit
7191d56a16
3 changed files with 15 additions and 5 deletions
|
@ -111,9 +111,15 @@ void raster_datasource::bind() const
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (mapnik::image_reader_exception const& ex)
|
||||||
|
{
|
||||||
|
std::cerr << "Raster Plugin: image reader exception caught:" << ex.what() << std::endl;
|
||||||
|
throw;
|
||||||
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
std::cerr << "Raster Plugin: exception caught" << std::endl;
|
std::cerr << "Raster Plugin: exception caught" << std::endl;
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
|
|
||||||
is_bound_ = true;
|
is_bound_ = true;
|
||||||
|
|
|
@ -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 (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
std::cerr << "Raster Plugin: exception caught" << std::endl;
|
std::cerr << "Raster Plugin: exception caught" << std::endl;
|
||||||
|
|
|
@ -97,7 +97,7 @@ void tiff_reader::init()
|
||||||
// TODO: error handling
|
// TODO: error handling
|
||||||
TIFFSetWarningHandler(0);
|
TIFFSetWarningHandler(0);
|
||||||
TIFF* tif = load_if_exists(file_name_);
|
TIFF* tif = load_if_exists(file_name_);
|
||||||
if (!tif) return;
|
if (!tif) throw image_reader_exception ("Can't load tiff file");
|
||||||
|
|
||||||
char msg[1024];
|
char msg[1024];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue