Config: add backtrace when trying to access configuration value before initialization

This commit is contained in:
Benjamin Renard 2023-03-03 10:32:01 +01:00
parent 9f213f8065
commit 8e5b0b0b2c
Signed by: bn8
GPG key ID: 3E2E1CE1907115BC

View file

@ -145,7 +145,10 @@ Class Config {
$value = self :: $extra_variables[$key];
}
else if (!is_array($config) && !self :: loaded()) {
Log :: fatal('Configuration not loaded (on getting %s)', $key);
Log :: fatal(
"Configuration not loaded (on getting %s):\n%s",
$key, Log :: get_debug_backtrace_context()
);
exit(1);
}
else {