Add disk writer tool.
[dcpomatic.git] / src / lib / exceptions.cc
index c86f98da2e5912a90300484252c44ff8893a321d..d394ad4b2c4e41e1c8285e31b21efc3d1374e9c2 100644 (file)
@@ -27,10 +27,11 @@ using std::string;
 using std::runtime_error;
 
 /** @param f File that we were trying to open */
-OpenFileError::OpenFileError (boost::filesystem::path f, int error, bool reading)
+OpenFileError::OpenFileError (boost::filesystem::path f, int error, Mode mode)
        : FileError (
                String::compose (
-                       reading ? _("could not open file %1 for reading (%2)") : _("could not open file %1 for writing (%2)"),
+                       mode == READ_WRITE ? _("could not open file %1 for read/write (%2)") :
+                       (mode == READ ? _("could not open file %1 for read (%2)") : _("could not open file %1 for write (%2)")),
                        f.string(),
                        error),
                f
@@ -39,6 +40,13 @@ OpenFileError::OpenFileError (boost::filesystem::path f, int error, bool reading
 
 }
 
+FileNotFoundError::FileNotFoundError (boost::filesystem::path f)
+       : runtime_error(String::compose("File %1 not found", f.string()))
+       , _file (f)
+{
+
+}
+
 ReadFileError::ReadFileError (boost::filesystem::path f, int e)
        : FileError (String::compose (_("could not read from file %1 (%2)"), f.string(), strerror (e)), f)
 {
@@ -106,3 +114,20 @@ GLError::GLError (char const * last, int e)
 {
 
 }
+
+CopyError::CopyError (string m, int n)
+       : runtime_error (String::compose("%1 (%2)", m, n))
+       , _message (m)
+       , _number (n)
+{
+
+}
+
+VerifyError::VerifyError (string m, int n)
+       : runtime_error (String::compose("%1 (%2)", m, n))
+       , _message (m)
+       , _number (n)
+{
+
+}
+