From 00d0a99cfd1616e80efd86ec0531e5ca86a455e8 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 4 Sep 2022 20:54:38 +0200 Subject: [PATCH] Add a description of which part of the config failed to load. --- src/lib/config.cc | 4 ++-- src/lib/config.h | 7 ++++++- 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 Config::FailedToLoad; +boost::signals2::signal Config::FailedToLoad; boost::signals2::signal Config::Warning; boost::signals2::signal 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 FailedToLoad; + enum class LoadFailure { + CONFIG, + CINEMAS, + DKDM_RECIPIENTS + }; + static boost::signals2::signal FailedToLoad; /** Emitted if read() issued a warning which the user might want to know about */ static boost::signals2::signal Warning; /** Emitted if there is a something wrong the contents of our config. Handler can call -- 2.30.2