// parse the config returns a count of errors encountered.
const int oldWorkers = Config.workers;
- if ( parseConfigFile(ConfigFile) != 0) {
+ try {
+ if (parseConfigFile(ConfigFile) != 0) {
+ // for now any errors are a fatal condition...
+ self_destruct();
+ }
+ } catch (...) {
// for now any errors are a fatal condition...
+ debugs(1, DBG_CRITICAL, "FATAL: Unhandled exception parsing config file. " <<
+ " Run squid -k parse and check for errors.");
self_destruct();
}
+
if (oldWorkers != Config.workers) {
debugs(1, DBG_CRITICAL, "WARNING: Changing 'workers' (from " <<
oldWorkers << " to " << Config.workers <<
Format::Token::Init(); // XXX: temporary. Use a runners registry of pre-parse runners instead.
- parse_err = parseConfigFile(ConfigFile);
+ try {
+ parse_err = parseConfigFile(ConfigFile);
+ } catch (...) {
+ // for now any errors are a fatal condition...
+ debugs(1, DBG_CRITICAL, "FATAL: Unhandled exception parsing config file." <<
+ (opt_parse_cfg_only ? " Run squid -k parse and check for errors." : ""));
+ parse_err = 1;
+ }
Mem::Report();