Give a better error when opening a DCP with File -> Open by mistake (#1723).
[dcpomatic.git] / src / lib / exceptions.h
index 391258bd51bba7303fb7033266da0250e7444974..73b8cc85a7876259c594f5d1fee92acd9cd85897 100644 (file)
@@ -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
  */