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:
Anders Kaseorg
2020-06-11 16:35:37 -07:00
committed by Tim Abbott
parent 4b6d2cf25f
commit 1ed2d9b4a0
20 changed files with 71 additions and 58 deletions

View File

@@ -332,6 +332,6 @@ def do_rest_call(base_url: str,
response_message = ("An exception of type *%s* occurred for message `%s`! "
"See the Zulip server logs for more information." % (
type(e).__name__, event["command"]))
logging.exception(f"Outhook trigger failed:\n {e}")
logging.exception("Outhook trigger failed:")
fail_with_message(event, response_message)
notify_bot_owner(event, exception=e)