From 8c8d5f89c7c95c18b5e90f5cf09f746d4c74abc4 Mon Sep 17 00:00:00 2001 From: Lars Holmberg Date: Sat, 4 Jul 2020 22:14:13 +0200 Subject: [PATCH] Followup on #1462 Actually change log.unhandled_greenlet_exception (instead of importing it into a local variable and changing the copy). Print the whole traceback of the exception. --- locust/event.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/locust/event.py b/locust/event.py index 3624b53c41..1589f5c56f 100644 --- a/locust/event.py +++ b/locust/event.py @@ -1,5 +1,6 @@ import logging -from .log import unhandled_greenlet_exception +from . import log +import traceback class EventHook(object): """ @@ -36,8 +37,8 @@ def fire(self, *, reverse=False, **kwargs): try: handler(**kwargs) except Exception as e: - logging.error("Uncaught exception in event handler: %s", e) - unhandled_greenlet_exception = True + logging.error("Uncaught exception in event handler: \n%s", traceback.format_exc()) + log.unhandled_greenlet_exception = True class Events: