- improved error reporting in shape plugin
This commit is contained in:
parent
46228e8bfc
commit
9b3ef53338
4 changed files with 11 additions and 11 deletions
|
@ -123,12 +123,12 @@ void shape_datasource::bind() const
|
|||
}
|
||||
catch (datasource_exception& ex)
|
||||
{
|
||||
std::clog<<ex.what()<<std::endl;
|
||||
std::clog << "Shape Plugin: error processing field attributes, " << ex.what() << std::endl;
|
||||
throw;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
std::clog << "Shape Plugin: got exception... " << std::endl;
|
||||
std::clog << "Shape Plugin: error processing field attributes" << std::endl;
|
||||
throw;
|
||||
}
|
||||
|
||||
|
|
|
@ -57,14 +57,14 @@ shape_featureset<filterT>::shape_featureset(const filterT& filter,
|
|||
{
|
||||
std::ostringstream s;
|
||||
|
||||
s << "Shape Plugin: error no attribute by the name of '" << *pos << "'"
|
||||
s << "error no attribute by the name of '" << *pos << "'"
|
||||
<< ", available attributes are:";
|
||||
for (int i=0;i<shape_.dbf().num_fields();++i)
|
||||
{
|
||||
s << " '" << shape_.dbf().descriptor(i).name_ << "'";
|
||||
}
|
||||
|
||||
throw mapnik::datasource_exception( s.str() );
|
||||
throw mapnik::datasource_exception( "Shape Plugin: " + s.str() );
|
||||
}
|
||||
++pos;
|
||||
}
|
||||
|
|
|
@ -78,14 +78,14 @@ shape_index_featureset<filterT>::shape_index_featureset(const filterT& filter,
|
|||
{
|
||||
std::ostringstream s;
|
||||
|
||||
s << "Shape Plugin: error no attribute by the name of '" << *pos << "'"
|
||||
s << "error no attribute by the name of '" << *pos << "'"
|
||||
<< ", available attributes are:";
|
||||
for (int i=0;i<shape_.dbf().num_fields();++i)
|
||||
{
|
||||
s << " '" << shape_.dbf().descriptor(i).name_ << "'";
|
||||
}
|
||||
|
||||
throw mapnik::datasource_exception( s.str() );
|
||||
throw mapnik::datasource_exception( "Shape Plugin: " + s.str() );
|
||||
}
|
||||
++pos;
|
||||
}
|
||||
|
@ -224,7 +224,7 @@ feature_ptr shape_index_featureset<filterT>::next()
|
|||
}
|
||||
catch (...)
|
||||
{
|
||||
std::clog << "Shape Plugin: exception caught..." << std::endl;
|
||||
std::clog << "Shape Plugin: error processing attributes" << std::endl;
|
||||
}
|
||||
++pos;
|
||||
}
|
||||
|
|
|
@ -49,14 +49,14 @@ shape_io::shape_io(const std::string& shape_name)
|
|||
{
|
||||
if (!boost::filesystem::exists(shape_name + INDEX))
|
||||
{
|
||||
throw datasource_exception("Shape Plugin: Warning - Could not open index: '" + shape_name + INDEX + "' does not exist");
|
||||
throw datasource_exception("Shape Plugin: could not open index: '" + shape_name + INDEX + "' does not exist");
|
||||
}
|
||||
|
||||
index_= boost::shared_ptr<shape_file>(new shape_file(shape_name + INDEX));
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
std::cerr << "Shape Plugin: Warning - Could not open index: '" + shape_name + INDEX + "'" << std::endl;
|
||||
std::cerr << "Shape Plugin: warning - could not open index: '" + shape_name + INDEX + "'" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue