diff --git a/owrx/__main__.py b/owrx/__main__.py index 9512db86..c8d2dd2f 100644 --- a/owrx/__main__.py +++ b/owrx/__main__.py @@ -48,14 +48,9 @@ Support and info: https://groups.io/g/openwebrx for sig in [signal.SIGINT, signal.SIGTERM]: signal.signal(sig, handleSignal) - pm = Config.get() - - configErrors = Config.validateConfig() - if configErrors: - logger.error("your configuration contains errors. please address the following errors:") - for e in configErrors: - logger.error(e) - return + # config warmup + Config.validateConfig() + coreConfig = CoreConfig() featureDetector = FeatureDetector() if not featureDetector.is_available("core"): @@ -73,7 +68,7 @@ Support and info: https://groups.io/g/openwebrx Services.start() try: - server = ThreadedHttpServer(("0.0.0.0", CoreConfig().get_web_port()), RequestHandler) + server = ThreadedHttpServer(("0.0.0.0", coreConfig.get_web_port()), RequestHandler) server.serve_forever() except SignalException: WebSocketConnection.closeAll() diff --git a/owrx/config.py b/owrx/config.py index 7761a11a..89efd2ad 100644 --- a/owrx/config.py +++ b/owrx/config.py @@ -14,13 +14,9 @@ class ConfigNotFoundException(Exception): pass -class ConfigError(object): +class ConfigError(Exception): def __init__(self, key, message): - self.key = key - self.message = message - - def __str__(self): - return "Configuration Error (key: {0}): {1}".format(self.key, self.message) + super().__init__("Configuration Error (key: {0}): {1}".format(key, message)) class ConfigMigrator(ABC): @@ -167,8 +163,9 @@ class Config: @staticmethod def validateConfig(): - # no config check atm - return [] + # no config checks atm + # just basic loading verification + Config.get() @staticmethod def _migrate(config):