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-10-08 20:16:13 +0200
commit93e89bd463bd51de6823a6796288f6283f885b06 (patch)
tree9dd40b4023688b5624d2688eb16c23adb92b337e /src/lib/exceptions.cc
parent7ba1a973a8d06df646961c11dc34f73bd7141834 (diff)
Improve OpenFileError so that it doesn't say "opening for read"
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 481d2e89d..bf474e3ea 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