diff --git a/src/mapnik_envelope.cpp b/src/mapnik_envelope.cpp index 91e242d0a..4490c645e 100644 --- a/src/mapnik_envelope.cpp +++ b/src/mapnik_envelope.cpp @@ -31,7 +31,6 @@ // mapnik #include -#include using mapnik::coord; using mapnik::box2d; @@ -58,7 +57,7 @@ box2d from_string(std::string const& s) { std::stringstream ss; ss << "Could not parse bbox from string: '" << s << "'"; - throw mapnik::value_error(ss.str()); + throw std::invalid_argument(ss.str()); } } diff --git a/src/mapnik_python.cpp b/src/mapnik_python.cpp index 14523b034..c50b500d7 100644 --- a/src/mapnik_python.cpp +++ b/src/mapnik_python.cpp @@ -100,7 +100,6 @@ void export_logger(); #include #include #include -#include #include #include #include @@ -567,27 +566,6 @@ double scale_denominator(mapnik::Map const& map, bool geographic) return mapnik::scale_denominator(map.scale(), geographic); } -// http://docs.python.org/c-api/exceptions.html#standard-exceptions -void value_error_translator(mapnik::value_error const & ex) -{ - PyErr_SetString(PyExc_ValueError, ex.what()); -} - -void runtime_error_translator(std::runtime_error const & ex) -{ - PyErr_SetString(PyExc_RuntimeError, ex.what()); -} - -void out_of_range_error_translator(std::out_of_range const & ex) -{ - PyErr_SetString(PyExc_IndexError, ex.what()); -} - -void standard_error_translator(std::exception const & ex) -{ - PyErr_SetString(PyExc_RuntimeError, ex.what()); -} - unsigned mapnik_version() { return MAPNIK_VERSION; @@ -716,10 +694,6 @@ BOOST_PYTHON_MODULE(_mapnik) using mapnik::save_map; using mapnik::save_map_to_string; - register_exception_translator(&standard_error_translator); - register_exception_translator(&out_of_range_error_translator); - register_exception_translator(&value_error_translator); - register_exception_translator(&runtime_error_translator); #if defined(HAVE_CAIRO) && defined(HAVE_PYCAIRO) register_cairo(); #endif diff --git a/src/mapnik_style.cpp b/src/mapnik_style.cpp index 182943669..cd8871bb2 100644 --- a/src/mapnik_style.cpp +++ b/src/mapnik_style.cpp @@ -30,7 +30,6 @@ #pragma GCC diagnostic pop // mapnik -#include #include #include "mapnik_enumeration.hpp" #include @@ -54,7 +53,7 @@ void set_image_filters(feature_type_style & style, std::string const& filters) bool result = parse_image_filters(filters, new_filters); if (!result) { - throw mapnik::value_error("failed to parse image-filters: '" + filters + "'"); + throw std::invalid_argument("failed to parse image-filters: '" + filters + "'"); } #ifdef _WINDOWS style.image_filters() = new_filters; diff --git a/src/mapnik_svg.hpp b/src/mapnik_svg.hpp index 36763f7c0..ee0f1eaad 100644 --- a/src/mapnik_svg.hpp +++ b/src/mapnik_svg.hpp @@ -25,7 +25,6 @@ // mapnik #include #include -#include #pragma GCC diagnostic push #include @@ -51,7 +50,7 @@ void set_svg_transform(T& symbolizer, std::string const& transform_wkt) ss << "Could not parse transform from '" << transform_wkt << "', expected SVG transform attribute"; - throw mapnik::value_error(ss.str()); + throw std::invalid_argument(ss.str()); } symbolizer.set_image_transform(trans_expr); } diff --git a/src/mapnik_symbolizer.cpp b/src/mapnik_symbolizer.cpp index d2d1bf102..29693a67a 100644 --- a/src/mapnik_symbolizer.cpp +++ b/src/mapnik_symbolizer.cpp @@ -40,7 +40,6 @@ #include "mapnik_enumeration.hpp" #include "mapnik_svg.hpp" #include -#include #include // for known_svg_prefix_ #include #include diff --git a/src/python_grid_utils.cpp b/src/python_grid_utils.cpp index c2585732d..11abca1c3 100644 --- a/src/python_grid_utils.cpp +++ b/src/python_grid_utils.cpp @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include "python_grid_utils.hpp" @@ -271,7 +270,7 @@ boost::python::dict grid_encode( T const& grid, std::string const& format, bool { std::stringstream s; s << "'utf' is currently the only supported encoding format."; - throw mapnik::value_error(s.str()); + throw std::invalid_argument(s.str()); } } @@ -307,7 +306,7 @@ void render_layer_for_grid(mapnik::Map const& map, { std::stringstream s; s << "list of field names must be strings"; - throw mapnik::value_error(s.str()); + throw std::invalid_argument(s.str()); } }