diff --git a/src/common/configfacade.cpp b/src/common/configfacade.cpp index 1130fe78e..8c8d7b941 100644 --- a/src/common/configfacade.cpp +++ b/src/common/configfacade.cpp @@ -56,6 +56,10 @@ namespace lumiera { using util::isnil; using lib::Literal; + + /** storage and setup for the single system-wide config facade instance */ + lib::Depend Config::instance; + namespace { @@ -72,10 +76,6 @@ namespace lumiera { - /** storage for the single system-wide config facade instance */ - lib::Depend Config::instance; - - Config::Config () { string extendedConfigSearchPath = AppState::instance().fetchSetupValue (KEY_CONFIG_PATH); diff --git a/src/lib/dependency-factory.hpp b/src/lib/dependency-factory.hpp index 26ef30178..d97c9de9f 100644 --- a/src/lib/dependency-factory.hpp +++ b/src/lib/dependency-factory.hpp @@ -91,7 +91,13 @@ namespace lib { void* buildInstance() { - REQUIRE (ctorFunction_); + if (!ctorFunction_) + throw error::Fatal ("lib::Depend: attempt to retrieve a service object prior to initialisation " + "of the DependencyFactory. Typically, this happens due to a misconfiguration " + "regarding static initialisation order. When lib::Depend is placed into " + "a class static variable, then the definition and initialisation of that " + "variable must happen prior to the call which caused this exception." + ,error::LUMIERA_ERROR_LIFECYCLE); return ctorFunction_(); }