summaryrefslogtreecommitdiff
path: root/src/lib/exceptions.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-09-29 23:28:57 +0200
committerCarl Hetherington <cth@carlh.net>2019-09-29 23:28:57 +0200
commitab0e8cdcafdcb83096012380f674b8280474e851 (patch)
treeb89df2d9abcbf15e1a113db8ea3024aadc41edaa /src/lib/exceptions.cc
parent9a6d5d07edef459e6e7ac1708f32c34981d6cd05 (diff)
Improve OpenFileError so that it doesn't say "opening for read"v2.15.20
in one case where it should say "opening for read/write". Also add some unit tests for ReelWriter.
Diffstat (limited to 'src/lib/exceptions.cc')
-rw-r--r--src/lib/exceptions.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/exceptions.cc b/src/lib/exceptions.cc
index c86f98da2..99d4c3979 100644
--- a/src/lib/exceptions.cc
+++ b/src/lib/exceptions.cc
@@ -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