mirror of
https://github.com/zulip/zulip.git
synced 2025-10-30 19:43:47 +00:00
logging: Use logging.exception and exc_info for unexpected exceptions.
logging.exception() and logging.debug(exc_info=True), etc. automatically include a traceback. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
4b6d2cf25f
commit
1ed2d9b4a0
@@ -67,8 +67,8 @@ def get_expirable_session_var(session: Session, var_name: str, default_value: An
|
||||
|
||||
try:
|
||||
value, expire_at = (session[var_name]['value'], session[var_name]['expire_at'])
|
||||
except (KeyError, TypeError) as e:
|
||||
logging.warning("get_expirable_session_var: Variable %s: %s", var_name, e)
|
||||
except (KeyError, TypeError):
|
||||
logging.warning("get_expirable_session_var: error getting %s", var_name, exc_info=True)
|
||||
return default_value
|
||||
|
||||
if timestamp_to_datetime(expire_at) < timezone_now():
|
||||
|
||||
Reference in New Issue
Block a user