]> git.tdb.fi Git - libs/core.git/blobdiff - source/core/error.h
Win32 doesn't have execinfo.h, so don't include it
[libs/core.git] / source / core / error.h
index 1f9662e274b1d9b087d9cb16e5c1cf30f8c6811b..d030c41c12937e1a3846ce819c445cd2b953e308 100644 (file)
@@ -9,7 +9,7 @@ Distributed under the LGPL
 
 #include <exception>
 #include <string>
-#include "backtrace.h"
+#include "../debug/backtrace.h"
 
 namespace Msp {
 
@@ -23,10 +23,10 @@ public:
        ~Exception() throw() { }
 
        const char *what() const throw() { return w.c_str(); }
-       const Backtrace &get_backtrace() const throw() { return bt; }
+       const Debug::Backtrace &get_backtrace() const throw() { return bt; }
 private:
        std::string w;
-       Backtrace bt;
+       Debug::Backtrace bt;
 
 };
 
@@ -39,6 +39,15 @@ public:
        InvalidParameterValue(const std::string &w_): Exception(w_) { }
 };
 
+/**
+Thrown when a lookup from a map fails.
+*/
+class KeyError: public Exception
+{
+public:
+       KeyError(const std::string &w_): Exception(w_) { }
+};
+
 /**
 Thrown when the current object state doesn't allow the requested action.
 */