/* $Id$
This file is part of libmspcore
-Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions
+Copyright © 2006-2008 Mikko Rasa, Mikkosoft Productions
Distributed under the LGPL
*/
+
#ifndef MSP_CORE_ERROR_H_
#define MSP_CORE_ERROR_H_
Exception(const std::string &);
~Exception() throw() { }
- const char *what() const throw() { return w.c_str(); }
+ const char *what() const throw() { return wot.c_str(); }
+ Exception &at(const std::string &) throw();
+ const char *where() const throw() { return wer.c_str(); }
const Debug::Backtrace &get_backtrace() const throw() { return bt; }
private:
- std::string w;
+ std::string wot;
+ std::string wer;
Debug::Backtrace bt;
};
static std::string build_what(const std::string &, int);
};
+template<typename E>
+void throw_at(E e, const std::string &a)
+{ e.at(a); throw e; }
+
} // namespace Msp
#endif