diff --git a/src/color.cpp b/src/color.cpp index 9825de7fa..368d50d14 100644 --- a/src/color.cpp +++ b/src/color.cpp @@ -38,14 +38,7 @@ color::color( std::string const& css_string) blue_(0), alpha_(0xff) { - try - { - color_factory::init_from_string(*this,css_string); - } - catch (config_error const& err) - { - std::cerr << err.what() << std::endl; - } + color_factory::init_from_string(*this,css_string); } std::string color::to_string() const diff --git a/tests/python_tests/object_test.py b/tests/python_tests/object_test.py index f53945467..4c1c29236 100644 --- a/tests/python_tests/object_test.py +++ b/tests/python_tests/object_test.py @@ -402,6 +402,15 @@ def test_map_pickle(): eq_(pickle.loads(pickle.dumps(m)), m) # Color initialization + +@raises(Exception) # Boost.Python.ArgumentError +def test_color_init_errors(): + c = mapnik2.Color() + +@raises(RuntimeError) +def test_color_init_errors(): + c = mapnik2.Color('foo') # mapnik config + def test_color_init(): c = mapnik2.Color('blue')