From 02be26f6b89869cb7f3ced716cf5447b913d58d5 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 22 Jul 2010 10:26:02 -0700 Subject: uhd: added better throw warning to dict key not found --- host/include/uhd/types/dict.hpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'host/include') diff --git a/host/include/uhd/types/dict.hpp b/host/include/uhd/types/dict.hpp index 50a2b5c3b..de96ea768 100644 --- a/host/include/uhd/types/dict.hpp +++ b/host/include/uhd/types/dict.hpp @@ -20,7 +20,10 @@ #include #include +#include +#include #include +#include #include #include @@ -117,7 +120,10 @@ namespace uhd{ BOOST_FOREACH(const pair_t &p, _map){ if (p.first == key) return p.second; } - throw std::invalid_argument("key not found in dict"); + throw std::invalid_argument(str(boost::format( + "key \"%s\" not found in dict(%s, %s)" + ) % boost::lexical_cast(key) + % typeid(Key).name() % typeid(Val).name())); } /*! -- cgit v1.2.3