exit on config errors

This commit is contained in:
Blake Blackshear 2020-12-03 08:01:03 -06:00
parent f78b2c48a7
commit 527db52d5e

View File

@ -4,6 +4,7 @@ import multiprocessing as mp
import os import os
from logging.handlers import QueueHandler from logging.handlers import QueueHandler
from typing import Dict, List from typing import Dict, List
import sys
import yaml import yaml
from playhouse.sqlite_ext import SqliteExtDatabase from playhouse.sqlite_ext import SqliteExtDatabase
@ -139,8 +140,12 @@ class FrigateApp():
def start(self): def start(self):
self.init_logger() self.init_logger()
self.ensure_dirs() self.ensure_dirs()
# TODO: exit if config doesnt parse try:
self.init_config() self.init_config()
except Exception as e:
logger.error(f"Error parsing config: {e}")
self.log_process.terminate()
sys.exit(1)
self.init_queues() self.init_queues()
self.init_database() self.init_database()
self.init_mqtt() self.init_mqtt()