diff options
author | morpheus65535 <[email protected]> | 2022-06-14 09:01:19 -0400 |
---|---|---|
committer | morpheus65535 <[email protected]> | 2022-06-14 09:01:19 -0400 |
commit | 4640badd4bff12b709a20b76688a94e8172363bd (patch) | |
tree | d79197a0422c98750409d1b06b20d67a7d238b04 | |
parent | 27f4c41a0ecf70c5706584c869d48bac4837f062 (diff) | |
download | bazarr-4640badd4bff12b709a20b76688a94e8172363bd.tar.gz bazarr-4640badd4bff12b709a20b76688a94e8172363bd.zip |
no log: deal with potential exception with missing time zone info.
-rw-r--r-- | bazarr/api/system/status.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bazarr/api/system/status.py b/bazarr/api/system/status.py index 7f5b87d98..b8ae22e42 100644 --- a/bazarr/api/system/status.py +++ b/bazarr/api/system/status.py @@ -2,6 +2,7 @@ import os import platform +import logging from flask import jsonify from flask_restful import Resource @@ -24,6 +25,12 @@ class SystemStatus(Resource): if 'BAZARR_PACKAGE_AUTHOR' in os.environ and os.environ['BAZARR_PACKAGE_AUTHOR'] != '': package_version = f'{package_version} by {os.environ["BAZARR_PACKAGE_AUTHOR"]}' + try: + timezone = get_localzone_name() or "Undefined" + except Exception: + timezone = "Exception while getting time zone name." + logging.exception("BAZARR is unable to get configured time zone name.") + system_status = {} system_status.update({'bazarr_version': os.environ["BAZARR_VERSION"]}) system_status.update({'package_version': package_version}) @@ -35,6 +42,6 @@ class SystemStatus(Resource): os.path.dirname(__file__))))}) system_status.update({'bazarr_config_directory': args.config_dir}) system_status.update({'start_time': startTime}) - system_status.update({'timezone': get_localzone_name() or 'Undefined'}) + system_status.update({'timezone': timezone}) return jsonify(data=system_status) |