mapnik-org/mapnik — Issue #440: config_error throws a Python UserWarning as an exception
Author: artemp
Created: 2011-10-11 07:55:47+00:00
State: closed
Labels: Boost_Python_Binding

If a `config_error` is thrown in the C++ code, it gets turned into a Python exception via `PyErr_SetString()` [source:trunk/bindings/python/mapnik_python.cpp#L218]. But the class that is specified is `PyExc_UserWarning`, which means that in the python code it's raised as an error but is of a warning type. Confusing much?

Since `config_error` isn't actually a warning (ie. there are no alternative code paths), it should be changed into RuntimeError/ValueError/MapnikConfigError or something else that doesn't imply to the user that everything is okay.