From 62f36cca870ce8694f3dff504a2f05ee1d65e283 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Tue, 19 Mar 2024 03:45:21 +0100 Subject: Reword exception message --- mdpoly/expressions.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mdpoly/expressions.py b/mdpoly/expressions.py index 4600660..6765b93 100644 --- a/mdpoly/expressions.py +++ b/mdpoly/expressions.py @@ -379,8 +379,9 @@ class WithOps: import traceback stackstr = "".join(traceback.format_stack(bad._stack[0].frame)) raise RuntimeError(f"Expression {str(bad)} caused the previous exception. " - "Below is the call stack at the time when the bad expression " - "object was constructed: \n\n" + stackstr) from e + f"Specifically: \n {repr(bad)}. \n\n" + "Call stack at the time when the bad expression " + "object was constructed: \n" + stackstr) from e finally: def clear_stack(expr: Expr): -- cgit v1.2.1