X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fcore%2Fexcept.h;h=ed295f11cef6c50d7fb1c407a7c89852e2d8b2b6;hp=bf7c526c378695d353098ef694311ff8231226cc;hb=e14321c38b34ec1cc5641b267f031693a8f7bc27;hpb=cfc8e0b7b15ea505bd6a6a9599cbc5ce1e316963 diff --git a/source/core/except.h b/source/core/except.h index bf7c526..ed295f1 100644 --- a/source/core/except.h +++ b/source/core/except.h @@ -1,16 +1,9 @@ -/* $Id$ - -This file is part of libmspcore -Copyright © 2006-2008 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #ifndef MSP_CORE_ERROR_H_ #define MSP_CORE_ERROR_H_ #include #include -#include "../debug/backtrace.h" +#include namespace Msp { @@ -77,7 +70,7 @@ private: bool brief; public: - UsageError(const std::string &r, bool b=true): Exception(r), brief(b) { } + UsageError(const std::string &r, bool b = true): Exception(r), brief(b) { } bool get_brief() const { return brief; } }; @@ -97,6 +90,15 @@ private: static std::string build_what(const std::string &, int); }; +/** +Thrown when "impossible" things happen. +*/ +class LogicError: public Exception +{ +public: + LogicError(const std::string &w_): Exception(w_) { } +}; + template void throw_at(E e, const std::string &a) { e.at(a); throw e; }