File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 11import functools
22import time
3+ import traceback
34
45from memos .log import get_logger
56
@@ -35,6 +36,7 @@ def decorator(fn):
3536 def wrapper (* args , ** kwargs ):
3637 start = time .perf_counter ()
3738 exc_type = None
39+ exc_message = None
3840 result = None
3941 success_flag = False
4042
@@ -44,6 +46,7 @@ def wrapper(*args, **kwargs):
4446 return result
4547 except Exception as e :
4648 exc_type = type (e )
49+ exc_message = traceback .format_exc ()
4750 success_flag = False
4851
4952 if fallback is not None and callable (fallback ):
@@ -78,7 +81,9 @@ def wrapper(*args, **kwargs):
7881 status_info = f", status: { status } "
7982
8083 if not success_flag and exc_type is not None :
81- status_info += f", error: { exc_type .__name__ } "
84+ status_info += (
85+ f", error_type: { exc_type .__name__ } , error_message: { exc_message } "
86+ )
8287
8388 msg = (
8489 f"[TIMER_WITH_STATUS] { log_prefix or fn .__name__ } "
You can’t perform that action at this time.
0 commit comments