mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 08:33:07 +00:00
fix: improve resilience in strategy wrapper
This commit is contained in:
@@ -16,13 +16,15 @@ F = TypeVar("F", bound=Callable[..., Any])
|
|||||||
def __format_traceback(error: Exception) -> str:
|
def __format_traceback(error: Exception) -> str:
|
||||||
"""Format the traceback of an exception into a formatted string."""
|
"""Format the traceback of an exception into a formatted string."""
|
||||||
tb = error.__traceback__
|
tb = error.__traceback__
|
||||||
while tb:
|
try:
|
||||||
if tb.tb_frame.f_code.co_filename == __file__:
|
while tb:
|
||||||
# Skip frames from this file
|
if tb.tb_frame.f_code.co_filename == __file__:
|
||||||
tb = tb.tb_next
|
# Skip frames from this file
|
||||||
continue
|
tb = tb.tb_next
|
||||||
return f"{tb.tb_frame.f_code.co_qualname}:{tb.tb_lineno}"
|
continue
|
||||||
|
return f"{tb.tb_frame.f_code.co_qualname}:{tb.tb_lineno}"
|
||||||
|
except Exception:
|
||||||
|
return "<unavailable>"
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user