summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-09-04 20:54:38 +0200
committerCarl Hetherington <cth@carlh.net>2022-09-04 20:54:38 +0200
commit00d0a99cfd1616e80efd86ec0531e5ca86a455e8 (patch)
tree419dcbe48c3c2017dac44ce73316e7746a33d571 /src
parentc66c2f0cc3371a26edb6cf2198bcc3fc45b26079 (diff)
Add a description of which part of the config failed to load.
Diffstat (limited to 'src')
-rw-r--r--src/lib/config.cc4
-rw-r--r--src/lib/config.h7
2 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc
index d9a39077e..94595f9f8 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -69,7 +69,7 @@ using dcp::raw_convert;
Config* Config::_instance = 0;
int const Config::_current_version = 3;
-boost::signals2::signal<void ()> Config::FailedToLoad;
+boost::signals2::signal<void (Config::LoadFailure)> Config::FailedToLoad;
boost::signals2::signal<void (string)> Config::Warning;
boost::signals2::signal<bool (Config::BadReason)> Config::Bad;
@@ -611,7 +611,7 @@ catch (...) {
if (have_existing("config.xml") || have_existing("cinemas.xml") || have_existing("dkdm_recipients.xml")) {
backup ();
/* We have a config file but it didn't load */
- FailedToLoad ();
+ FailedToLoad(LoadFailure::CONFIG);
}
set_defaults ();
/* Make a new set of signing certificates and key */
diff --git a/src/lib/config.h b/src/lib/config.h
index 96016d75b..8fbdeaf95 100644
--- a/src/lib/config.h
+++ b/src/lib/config.h
@@ -1143,7 +1143,12 @@ public:
/** Emitted if read() failed on an existing Config file. There is nothing
a listener can do about it: this is just for information.
*/
- static boost::signals2::signal<void ()> FailedToLoad;
+ enum class LoadFailure {
+ CONFIG,
+ CINEMAS,
+ DKDM_RECIPIENTS
+ };
+ static boost::signals2::signal<void (LoadFailure)> FailedToLoad;
/** Emitted if read() issued a warning which the user might want to know about */
static boost::signals2::signal<void (std::string)> Warning;
/** Emitted if there is a something wrong the contents of our config. Handler can call