Skip to content

Commit

Permalink
Merge pull request #1962 from timbrel/tune-friendly-traceback
Browse files Browse the repository at this point in the history
Tune friendly traceback
  • Loading branch information
kaste authored Dec 10, 2024
2 parents 7947986 + 19d58f7 commit f3fad6a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,12 @@ def user_friendly_traceback(exception_s: type[BaseException] | tuple[type[BaseEx
found_culprit = False
for frame in reversed(traceback.extract_tb(tb)):
relative_filename = frame.filename.split(GITSAVVY__)[-1]
print(f"| {relative_filename}:{frame.lineno}")
if not found_culprit and relative_filename.startswith(CORE_COMMANDS__):
found_culprit = True
print(f"|> {frame.line}")
left_column = f"|> {relative_filename}:{frame.lineno}"
else:
left_column = f"| {relative_filename}:{frame.lineno}"
print(f"{left_column:<40} {frame.line}")


def it_runs_on_ui():
Expand Down

0 comments on commit f3fad6a

Please sign in to comment.