diff --git a/neon_utils/log_aggregators/__init__.py b/neon_utils/log_aggregators/__init__.py index 10d80db5..48a4d79f 100644 --- a/neon_utils/log_aggregators/__init__.py +++ b/neon_utils/log_aggregators/__init__.py @@ -37,10 +37,13 @@ def init_log_aggregators(config: dict = None): from ovos_config.config import Configuration config = config or Configuration() for service_name, handler in _service_name_to_handler.items(): - service_config = _get_log_aggregator_config(config=config, name=service_name) - if bool(service_config.pop('enabled', False)): - service_module = importlib.import_module(f'.{service_name}', __name__) - getattr(service_module, handler)(config=service_config) + try: + service_config = _get_log_aggregator_config(config=config, name=service_name) + if bool(service_config.pop('enabled', False)): + service_module = importlib.import_module(f'.{service_name}', __name__) + getattr(service_module, handler)(config=service_config) + except Exception as e: + pass def _get_log_aggregator_config(config: dict, name: str): diff --git a/neon_utils/log_aggregators/sentry.py b/neon_utils/log_aggregators/sentry.py index 29fecb74..b3294367 100644 --- a/neon_utils/log_aggregators/sentry.py +++ b/neon_utils/log_aggregators/sentry.py @@ -26,12 +26,13 @@ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import sentry_sdk SENTRY_SDK_REQUIRED_KEYS = {'dsn'} def init_sentry(config: dict): + import sentry_sdk + missing_required_keys = SENTRY_SDK_REQUIRED_KEYS.difference(config.keys()) if missing_required_keys: raise KeyError(f'Sentry SDK configuration missing required keys: {missing_required_keys}')