From 6fa1b02888f655f6c3b53b60c76a0f3bfdad1704 Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 9 Mar 2023 11:09:58 -0500 Subject: [PATCH] Add better logging on tz failures --- app/classes/shared/server.py | 3 ++- app/classes/shared/tasks.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/classes/shared/server.py b/app/classes/shared/server.py index 9ca54a90..fa68eb62 100644 --- a/app/classes/shared/server.py +++ b/app/classes/shared/server.py @@ -134,9 +134,10 @@ class ServerInstance: self.last_backup_failed = False try: self.tz = get_localzone() - except ZoneInfoNotFoundError: + except ZoneInfoNotFoundError as e: logger.error( "Could not capture time zone from system. Falling back to Europe/London" + f" error: {e}" ) self.tz = ZoneInfo("Europe/London") self.server_scheduler = BackgroundScheduler(timezone=str(self.tz)) diff --git a/app/classes/shared/tasks.py b/app/classes/shared/tasks.py index 8f51842b..dccaf4e3 100644 --- a/app/classes/shared/tasks.py +++ b/app/classes/shared/tasks.py @@ -47,9 +47,10 @@ class TasksManager: self.tornado: Webserver = Webserver(helper, controller, self) try: self.tz = get_localzone() - except ZoneInfoNotFoundError: + except ZoneInfoNotFoundError as e: logger.error( "Could not capture time zone from system. Falling back to Europe/London" + f" error: {e}" ) self.tz = "Europe/London" self.scheduler = BackgroundScheduler(timezone=str(self.tz))