X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fexceptions.h;h=7220af35f5ba0d8c4603e0340d9324e74cf0812b;hb=5c9e39df078aab9f03ae186d0758d4d710f90bab;hp=c2f82e15ba5315bca041b63bd925b4c164f2d658;hpb=67a68bd971ebe1b35daa3f75873b4ccb53c00ba0;p=dcpomatic.git diff --git a/src/lib/exceptions.h b/src/lib/exceptions.h index c2f82e15b..7220af35f 100644 --- a/src/lib/exceptions.h +++ b/src/lib/exceptions.h @@ -39,7 +39,7 @@ extern "C" { class DecodeError : public std::runtime_error { public: - DecodeError (std::string s) + explicit DecodeError (std::string s) : std::runtime_error (s) {} }; @@ -50,7 +50,7 @@ public: class EncodeError : public std::runtime_error { public: - EncodeError (std::string s) + explicit EncodeError (std::string s) : std::runtime_error (s) {} }; @@ -84,7 +84,7 @@ private: class JoinError : public std::runtime_error { public: - JoinError (std::string s) + explicit JoinError (std::string s) : std::runtime_error (s) {} }; @@ -158,7 +158,7 @@ class MissingSettingError : public SettingError { public: /** @param s Name of setting that was required */ - MissingSettingError (std::string s); + explicit MissingSettingError (std::string s); }; /** @class BadSettingError @@ -181,7 +181,7 @@ public: class NetworkError : public std::runtime_error { public: - NetworkError (std::string s) + explicit NetworkError (std::string s) : std::runtime_error (s) {} }; @@ -192,9 +192,19 @@ public: class KDMError : public std::runtime_error { public: - KDMError (std::string s) - : std::runtime_error (s) - {} + KDMError (std::string s, std::string d); + + std::string summary () const { + return _summary; + } + + std::string detail () const { + return _detail; + } + +private: + std::string _summary; + std::string _detail; }; /** @class PixelFormatError @@ -218,7 +228,7 @@ public: class DCPError : public std::runtime_error { public: - DCPError (std::string s) + explicit DCPError (std::string s) : std::runtime_error (s) {} }; @@ -227,19 +237,19 @@ class InvalidSignerError : public std::runtime_error { public: InvalidSignerError (); - InvalidSignerError (std::string reason); + explicit InvalidSignerError (std::string reason); }; class ProgrammingError : public std::runtime_error { public: - ProgrammingError (std::string file, int line); + ProgrammingError (std::string file, int line, std::string message = ""); }; class TextEncodingError : public std::runtime_error { public: - TextEncodingError (std::string s) + explicit TextEncodingError (std::string s) : std::runtime_error (s) {} }; @@ -247,9 +257,15 @@ public: class OldFormatError : public std::runtime_error { public: - OldFormatError (std::string s) + explicit OldFormatError (std::string s) : std::runtime_error (s) {} }; +class KDMAsContentError : public std::runtime_error +{ +public: + KDMAsContentError (); +}; + #endif