Skip to content

Commit

Permalink
feat: add traceback to error message
Browse files Browse the repository at this point in the history
  • Loading branch information
joschkabraun committed Jul 1, 2024
1 parent 7076a93 commit 22a642c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions parea/utils/trace_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import logging
import os
import threading
import traceback
from collections import ChainMap
from datetime import datetime
from functools import wraps
Expand Down Expand Up @@ -263,7 +264,7 @@ async def async_wrapper(*args, **kwargs):
return result
except Exception as e:
logger.exception(f"Error occurred in function {func.__name__}, {e}")
fill_trace_data(trace_id, {"error": str(e)}, UpdateTraceScenario.ERROR)
fill_trace_data(trace_id, {"error": traceback.format_exc()}, UpdateTraceScenario.ERROR)
raise e
finally:
try:
Expand All @@ -283,7 +284,7 @@ def wrapper(*args, **kwargs):
return result
except Exception as e:
logger.exception(f"Error occurred in function {func.__name__}, {e}")
fill_trace_data(trace_id, {"error": str(e)}, UpdateTraceScenario.ERROR)
fill_trace_data(trace_id, {"error": traceback.format_exc()}, UpdateTraceScenario.ERROR)
raise e
finally:
try:
Expand Down

0 comments on commit 22a642c

Please sign in to comment.