shutdown if user_config exists but is broken
This commit is contained in:
@@ -448,6 +448,7 @@ class WTVShared {
|
|||||||
var minisrv_user_config = this.parseJSON(this.fs.readFileSync(user_config_filename));
|
var minisrv_user_config = this.parseJSON(this.fs.readFileSync(user_config_filename));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw ("ERROR: Could not read user_config.json", e);
|
throw ("ERROR: Could not read user_config.json", e);
|
||||||
|
shutdown('SIGTERM');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var minisrv_user_config = {}
|
var minisrv_user_config = {}
|
||||||
@@ -596,11 +597,12 @@ class WTVShared {
|
|||||||
try {
|
try {
|
||||||
if (notices || reload_notice) console.log(" *** Reading user configuration...");
|
if (notices || reload_notice) console.log(" *** Reading user configuration...");
|
||||||
var minisrv_user_config = this.getUserConfig()
|
var minisrv_user_config = this.getUserConfig()
|
||||||
if (!minisrv_user_config) throw "ERROR: Could not read user_config.json";
|
if (!minisrv_user_config) throw "WARN: Could not read user_config.json";
|
||||||
try {
|
try {
|
||||||
minisrv_config = integrateConfig(minisrv_config, minisrv_user_config)
|
minisrv_config = integrateConfig(minisrv_config, minisrv_user_config)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("ERROR: Could not read user_config.json", e);
|
console.error("ERROR: Could not read user_config.json", e);
|
||||||
|
shutdown('SIGTERM');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (minisrv_config.config.debug_flags) {
|
if (minisrv_config.config.debug_flags) {
|
||||||
|
|||||||
Reference in New Issue
Block a user