From 527db52d5e4c82511246ab6d14221eb85b42f13d Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Thu, 3 Dec 2020 08:01:03 -0600 Subject: [PATCH] exit on config errors --- frigate/app.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/frigate/app.py b/frigate/app.py index a73823d61..32083b2bc 100644 --- a/frigate/app.py +++ b/frigate/app.py @@ -4,6 +4,7 @@ import multiprocessing as mp import os from logging.handlers import QueueHandler from typing import Dict, List +import sys import yaml from playhouse.sqlite_ext import SqliteExtDatabase @@ -139,8 +140,12 @@ class FrigateApp(): def start(self): self.init_logger() self.ensure_dirs() - # TODO: exit if config doesnt parse - self.init_config() + try: + 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_database() self.init_mqtt()