when feature put/get throws, print the key that does not exist
This commit is contained in:
parent
6dfb3604a4
commit
a13b3f650c
1 changed files with 7 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue