diff --git a/include/mapnik/feature_style_processor_impl.hpp b/include/mapnik/feature_style_processor_impl.hpp index b03b8732b..80f0112d1 100644 --- a/include/mapnik/feature_style_processor_impl.hpp +++ b/include/mapnik/feature_style_processor_impl.hpp @@ -232,6 +232,7 @@ void feature_style_processor::apply_to_layer(layer const& lay, Proces int buffer_size, std::set& names) { +try { std::vector const& style_names = lay.styles(); unsigned int num_styles = style_names.size(); @@ -548,6 +549,13 @@ void feature_style_processor::apply_to_layer(layer const& lay, Proces #endif p.end_layer_processing(lay); + +} catch (const std::exception& e) { + std::ostringstream m; + m << lay.name() << ": " << e.what(); + throw std::runtime_error(m.str().c_str()); +} + } diff --git a/plugins/input/postgis/connection.hpp b/plugins/input/postgis/connection.hpp index d8726aef0..c725ab91a 100644 --- a/plugins/input/postgis/connection.hpp +++ b/plugins/input/postgis/connection.hpp @@ -107,7 +107,8 @@ public: if (! result || (PQresultStatus(result) != PGRES_TUPLES_OK)) { - std::string err_msg = status(); + std::string err_msg = "Postgis Plugin: "; + err_msg += status(); err_msg += "\nFull sql was: '"; err_msg += sql; err_msg += "'\n";