don't exit with error if only sensor warnings were printed

This commit is contained in:
Daniel Langbein 2024-08-15 17:42:07 +02:00
parent 0e1405146d
commit f2823e3cc9
Signed by: langfingaz
GPG Key ID: 6C47C753F0823002

View File

@ -66,9 +66,14 @@ def log():
print_err('\nRUNTIME ERROR: Some loggers could not fetch sensor data!') 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))]) 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) 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): def print_exs(exs: list[Exception], headers: list):
for e, header in zip(exs, headers): for e, header in zip(exs, headers):