summaryrefslogtreecommitdiff
path: root/src/lib/exceptions.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-03-11 20:23:11 +0000
committerCarl Hetherington <cth@carlh.net>2020-03-11 21:24:28 +0100
commitbc36ddea65fda2088f7e8fa98390e3feac07df84 (patch)
treefb9b7f9ff44f256a2b740e5c5b97893ca5ece82e /src/lib/exceptions.h
parent755694dd44cf5a012825b8b822da3738461b81ad (diff)
Give a better error when opening a DCP with File -> Open by mistake (#1723).
Diffstat (limited to 'src/lib/exceptions.h')
-rw-r--r--src/lib/exceptions.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/exceptions.h b/src/lib/exceptions.h
index 391258bd5..73b8cc85a 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
*/