From 5e224bd705b33a4574e379490a94d5063fdeaf00 Mon Sep 17 00:00:00 2001 From: artemp Date: Thu, 14 Mar 2013 09:52:23 +0000 Subject: [PATCH] + better error reporting --- include/mapnik/params_impl.hpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/include/mapnik/params_impl.hpp b/include/mapnik/params_impl.hpp index 9d64f0b90..85a74a7fb 100644 --- a/include/mapnik/params_impl.hpp +++ b/include/mapnik/params_impl.hpp @@ -148,16 +148,17 @@ struct value_extractor_visitor : public boost::static_visitor<> template void operator () (T1 val) const { - // TODO try { var_ = boost::lexical_cast(val); } - catch (boost::bad_lexical_cast & ) {} - //std::string err_msg = (boost::format("No conversion from %s to %s") - // % typeid(T1).name() - // % typeid(T).name()).str(); - //throw std::runtime_error(err_msg); + catch (boost::bad_lexical_cast & ) + { + std::string err_msg = (boost::format("Failed converting from %s to %s") + % typeid(T1).name() + % typeid(T).name()).str(); + throw std::runtime_error(err_msg); + } }