X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fexceptions.h;h=268e8c36d200771d84e291ccd90e8f215da54c29;hb=ed1a6b0bf1a2c781a22640fd8a0c44a79f063bae;hp=90a0abfc717d46cfa697b92fef0dccba62795620;hpb=b6c780d3107557d452c6612d715d01e2be52dbda;p=dcpomatic.git diff --git a/src/lib/exceptions.h b/src/lib/exceptions.h index 90a0abfc7..268e8c36d 100644 --- a/src/lib/exceptions.h +++ b/src/lib/exceptions.h @@ -24,14 +24,14 @@ #ifndef DCPOMATIC_EXCEPTIONS_H #define DCPOMATIC_EXCEPTIONS_H -#include -#include -#include -#include #include extern "C" { #include } +#include +#include +#include +#include /** @class StringError * @brief A parent class for exceptions using messages held in a std::string @@ -40,9 +40,9 @@ class StringError : public std::exception { public: /** @param w Error message */ - StringError (std::string w) { - _what = w; - } + StringError (std::string w) + : _what (w) + {} virtual ~StringError () throw () {} @@ -259,6 +259,12 @@ public: InvalidSignerError (); }; +class ProgrammingError : public StringError +{ +public: + ProgrammingError (std::string file, int line); +}; + /** @class ExceptionStore * @brief A parent class for classes which have a need to catch and * re-throw exceptions. @@ -290,8 +296,8 @@ public: } } -protected: - +protected: + void store_current () { boost::mutex::scoped_lock lm (_mutex); _exception = boost::current_exception ();