mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-30 08:35:52 -04:00
Made the "Unknown class key" exception slightly more helpful
This commit is contained in:
parent
a723ad8f29
commit
13be61812a
@ -184,10 +184,13 @@ namespace MWWorld
|
|||||||
|
|
||||||
const Class& Class::get (const std::string& key)
|
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);
|
std::map<std::string, boost::shared_ptr<Class> >::const_iterator iter = sClasses.find (key);
|
||||||
|
|
||||||
if (iter==sClasses.end())
|
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;
|
return *iter->second;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user