From 13be61812a101d2278234044cf72a4bc5fd27440 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 31 Mar 2013 10:16:02 +0200 Subject: [PATCH] Made the "Unknown class key" exception slightly more helpful --- apps/openmw/mwworld/class.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwworld/class.cpp b/apps/openmw/mwworld/class.cpp index 876328641..1eb2f35bd 100644 --- a/apps/openmw/mwworld/class.cpp +++ b/apps/openmw/mwworld/class.cpp @@ -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 >::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; }