Stop silently catching exceptions when config load fails.
authorCarl Hetherington <cth@carlh.net>
Tue, 12 Jul 2016 22:32:13 +0000 (23:32 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 12 Jul 2016 22:32:13 +0000 (23:32 +0100)
I'm not sure why this was added, but it could hide serious
problems during config load: especially failures to load/create
_signer_chain which has been seen in the wild several times.

src/lib/config.cc

index 91966eefb323e04ceeab951ead1da994065a90fd..c483734f85f5f40a71220d01a6c90606b36cd2d5 100644 (file)
@@ -145,12 +145,10 @@ void
 Config::read ()
 {
        if (!have_existing ("config.xml")) {
-               cout << "No existing config.xml; creating chains.\n";
                /* Make a new set of signing certificates and key */
                _signer_chain = create_certificate_chain ();
                /* And similar for decryption of KDMs */
                _decryption_chain = create_certificate_chain ();
-               cout << "Writing config.\n";
                write ();
                return;
        }
@@ -337,16 +335,7 @@ Config::instance ()
 {
        if (_instance == 0) {
                _instance = new Config;
-               try {
-                       _instance->read ();
-               } catch (exception& e) {
-                       /* configuration load failed; never mind, just
-                          stick with the default.
-                       */
-                       cerr << "dcpomatic: warning: configuration did not load (" << e.what() << "); using defaults\n";
-               } catch (...) {
-                       cerr << "dcpomatic: warning: configuration did not load; using defaults\n";
-               }
+               _instance->read ();
        }
 
        return _instance;