From 38cd12a95b33fae974e4227e62babfbf3f70e998 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Sun, 12 Dec 2021 11:46:15 +0530 Subject: [PATCH 1/2] fix: remove bench path from traceback This is mostly useless for debugging and clutters the error message. --- frappe/utils/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frappe/utils/__init__.py b/frappe/utils/__init__.py index 1623fa7002..b29b2fb7d6 100644 --- a/frappe/utils/__init__.py +++ b/frappe/utils/__init__.py @@ -240,7 +240,9 @@ def get_traceback() -> str: return "" trace_list = traceback.format_exception(exc_type, exc_value, exc_tb) - return "".join(cstr(t) for t in trace_list) + bench_path = get_bench_path() + + return "".join(cstr(t) for t in trace_list).replace(bench_path, "") def log(event, details): frappe.logger().info(details) From 00d38d568c0f5f82cca908a08421b1d4d32906b5 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Sun, 12 Dec 2021 15:20:50 +0530 Subject: [PATCH 2/2] fix: remove slash prefix --- frappe/utils/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/utils/__init__.py b/frappe/utils/__init__.py index b29b2fb7d6..ec150125cb 100644 --- a/frappe/utils/__init__.py +++ b/frappe/utils/__init__.py @@ -240,7 +240,7 @@ def get_traceback() -> str: return "" trace_list = traceback.format_exception(exc_type, exc_value, exc_tb) - bench_path = get_bench_path() + bench_path = get_bench_path() + "/" return "".join(cstr(t) for t in trace_list).replace(bench_path, "")