X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fexceptions.h;h=0f8a2eda27a6b9fa7a42dab355331953ea51a691;hb=12f3a134e76a666b577cd20a193d3b650e0c5b6a;hp=391258bd51bba7303fb7033266da0250e7444974;hpb=2ba5edb6761dbb14e4906200cb4e57c4180541ff;p=dcpomatic.git diff --git a/src/lib/exceptions.h b/src/lib/exceptions.h index 391258bd5..0f8a2eda2 100644 --- a/src/lib/exceptions.h +++ b/src/lib/exceptions.h @@ -117,6 +117,22 @@ public: OpenFileError (boost::filesystem::path f, int error, Mode mode); }; +class FileNotFoundError : public std::runtime_error +{ +public: + FileNotFoundError (boost::filesystem::path f); + virtual ~FileNotFoundError () throw () {} + + /** @return name of the file that this exception concerns */ + boost::filesystem::path file () const { + return _file; + } + +private: + /** name of the file that this exception concerns */ + boost::filesystem::path _file; +}; + /** @class ReadFileError. * @brief Indicates that some error occurred when trying to read from a file */ @@ -298,5 +314,47 @@ public: GLError (char const * last, int e); }; +/** @class CopyError + * @brief An error which occurs when copying a DCP to a distribution drive. + */ +class CopyError : public std::runtime_error +{ +public: + CopyError (std::string s, int n); + virtual ~CopyError () throw () {} + std::string message () const { + return _message; + } + + int number () const { + return _number; + } + +private: + std::string _message; + int _number; +}; + +/** @class VerifyError + * @brief An error which occurs when verifying a DCP that we copied to a distribution drive. + */ +class VerifyError : public std::runtime_error +{ +public: + VerifyError (std::string s, int n); + virtual ~VerifyError () throw () {} + + std::string message () const { + return _message; + } + + int number () const { + return _number; + } + +private: + std::string _message; + int _number; +}; #endif