-/* $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_
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; }
};
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<typename E>
void throw_at(E e, const std::string &a)
{ e.at(a); throw e; }