From caa2916305f3f79b088b2621d4f975a24e667b92 Mon Sep 17 00:00:00 2001
From: Justin Pettit <justin.pettit@networktocode.com>
Date: Wed, 20 Mar 2024 17:37:39 -0500
Subject: [PATCH] more testing

---
 nornir_nautobot/plugins/tasks/dispatcher/default.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nornir_nautobot/plugins/tasks/dispatcher/default.py b/nornir_nautobot/plugins/tasks/dispatcher/default.py
index e88dd2c..da55774 100644
--- a/nornir_nautobot/plugins/tasks/dispatcher/default.py
+++ b/nornir_nautobot/plugins/tasks/dispatcher/default.py
@@ -175,7 +175,7 @@ def generate_config(
                 jinja_env=jinja_env,
             )[0].result
         except NornirSubTaskError as exc:
-            stack_trace = traceback.format_exc()
+            stack_trace = "".join(traceback.format_exception(type(exc.result.exception), exc.result.exception, exc.result.exception.__traceback__))
             if isinstance(exc.result.exception, jinja2.exceptions.UndefinedError):  # pylint: disable=no-else-raise
                 error_msg = (
                     f"`E1010:` There was a jinja2.exceptions.UndefinedError error: ``{str(exc.result.exception)}``"