X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Flib%2Fexceptions.h;h=618a03f4326510c8e532481ce899a7fb1dfcf18e;hb=0f9f004c50a8bea6b87d5a1636f95f67066e5187;hp=93be3999b29a84feeda8e5584052c29872753aaf;hpb=689fa55d1529ad88449ca464e9107c4dcc54d1cb;p=dcpomatic.git diff --git a/src/lib/exceptions.h b/src/lib/exceptions.h index 93be3999b..618a03f43 100644 --- a/src/lib/exceptions.h +++ b/src/lib/exceptions.h @@ -50,12 +50,20 @@ public: {} DecodeError (std::string function, std::string caller) - : std::runtime_error (String::compose("%1 failed [%2", function, caller)) + : std::runtime_error (String::compose("%1 failed [%2]", function, caller)) {} DecodeError (std::string function, std::string caller, int error) : std::runtime_error (String::compose("%1 failed [%2] (%3)", function, caller, error)) {} + + DecodeError (std::string function, std::string caller, boost::filesystem::path file) + : std::runtime_error (String::compose("%1 failed [%2] (%3)", function, caller, file.string())) + {} + + DecodeError (std::string function, std::string caller, int error, boost::filesystem::path file) + : std::runtime_error (String::compose("%1 failed [%2] (%3) (%4)", function, caller, error, file.string())) + {} }; @@ -245,9 +253,19 @@ public: class NetworkError : public std::runtime_error { public: - explicit NetworkError (std::string s) - : std::runtime_error (s) - {} + explicit NetworkError (std::string s, boost::optional d = boost::optional()); + + std::string summary () const { + return _summary; + } + + boost::optional detail () const { + return _detail; + } + +private: + std::string _summary; + boost::optional _detail; }; @@ -317,6 +335,15 @@ public: }; +class CPLNotFoundError : public DCPError +{ +public: + CPLNotFoundError(std::string id) + : DCPError(String::compose("CPL %1 not found", id)) + {} +}; + + class InvalidSignerError : public std::runtime_error { public: @@ -369,7 +396,8 @@ public: class GLError : public std::runtime_error { public: - GLError (char const * last, int e); + GLError (char const* last, int e); + GLError (char const* message); }; @@ -397,7 +425,7 @@ private: /** @class CommunicationFailedError - * @brief Communcation between dcpomatic2_disk and _disk_writer failed somehow. + * @brief Communication between dcpomatic2_disk and _disk_writer failed somehow. */ class CommunicationFailedError : public CopyError {