1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-21 11:09:43 +00:00

Made the "Unknown class key" exception slightly more helpful

This commit is contained in:
scrawl 2013-03-31 10:16:02 +02:00
parent a723ad8f29
commit 13be61812a

View file

@ -184,10 +184,13 @@ namespace MWWorld
const Class& Class::get (const std::string& key)
{
if (key.empty())
throw std::logic_error ("Class::get(): attempting to get an empty key");
std::map<std::string, boost::shared_ptr<Class> >::const_iterator iter = sClasses.find (key);
if (iter==sClasses.end())
throw std::logic_error ("unknown class key: " + key);
throw std::logic_error ("Class::get(): unknown class key: " + key);
return *iter->second;
}