when feature put/get throws, print the key that does not exist

This commit is contained in:
Dane Springmeyer 2012-02-14 14:57:03 -08:00
parent 6dfb3604a4
commit a13b3f650c

View file

@ -128,7 +128,9 @@ public:
data_[itr->second] = val;
}
else
throw std::out_of_range("Key doesn't exist");
{
throw std::out_of_range(std::string("Key does not exist: '") + key + "'");
}
}
@ -162,7 +164,10 @@ public:
{
return data_[itr->second];
}
throw std::out_of_range("Key doesn't exist");
else
{
throw std::out_of_range(std::string("Key does not exist: '") + key + "'");
}
}
value_type const& get(std::size_t index) const