From 3bd2fea810dd1569bd7c1dfaa6d88340cab4035b Mon Sep 17 00:00:00 2001 From: Hsin-Fang Chiang Date: Fri, 1 Nov 2024 11:42:49 -0700 Subject: [PATCH] Add a message for _log.exception() Otherwise it complains about the required positional argument --- python/activator/activator.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/activator/activator.py b/python/activator/activator.py index def004db..0d43f54b 100644 --- a/python/activator/activator.py +++ b/python/activator/activator.py @@ -347,9 +347,9 @@ def next_visit_handler() -> tuple[str, int]: try: try: expected_visit = parse_next_visit(flask.request) - except ValueError as msg: - _log.exception() - return f"Bad Request: {msg}", 400 + except ValueError as e: + _log.exception("Bad Request: %s", e) + return f"Bad Request: {e}", 400 process_visit(expected_visit) return "Pipeline executed", 200 except GracefulShutdownInterrupt: @@ -524,7 +524,7 @@ def process_visit(expected_visit: FannedOutVisit): def invalid_visit(e: InvalidVisitError) -> tuple[str, int]: - _log.exception() + _log.exception("Invalid visit: %s", e) return f"Cannot process visit: {e}.", 422