From f2823e3cc9427b6936d4276b8bfea21efb7e4593 Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Thu, 15 Aug 2024 17:42:07 +0200 Subject: [PATCH] don't exit with error if only sensor warnings were printed --- src/de/p1st/monitor/main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/de/p1st/monitor/main.py b/src/de/p1st/monitor/main.py index 78bf4e3..83c8b30 100755 --- a/src/de/p1st/monitor/main.py +++ b/src/de/p1st/monitor/main.py @@ -66,9 +66,14 @@ def log(): print_err('\nRUNTIME ERROR: Some loggers could not fetch sensor data!') print_exs(logger_read_exs, [f'{n}.' for n in range(1, 1 + len(logger_read_exs))]) - if len(logger_arg_exs) + len(logger_read_exs) > 0 or logger_warnings > 0: + # End with error if any configuration or runtime errors occurred. + if len(logger_arg_exs) + len(logger_read_exs) > 0: exit(1) + # End with error if any logger has printed warnings (e.g. sensor value too high). + # if logger_warnings > 0: + # exit(1) + def print_exs(exs: list[Exception], headers: list): for e, header in zip(exs, headers):