From bc36ddea65fda2088f7e8fa98390e3feac07df84 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 11 Mar 2020 20:23:11 +0000 Subject: Give a better error when opening a DCP with File -> Open by mistake (#1723). --- src/lib/exceptions.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/lib/exceptions.h') 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 */ -- cgit v1.2.3