Skip to content

Commit

Permalink
Show traceback by default (#2862)
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Su <[email protected]>
  • Loading branch information
pingsutw authored Oct 25, 2024
1 parent 57f583e commit c5cc389
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions flytekit/clis/sdk_in_container/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,14 @@ def pretty_print_traceback(e: Exception, verbosity: int = 1):
Print the traceback in a nice formatted way if verbose is set to True.
"""
console = Console()
unwanted_module_names = ["importlib", "click", "rich_click"]

if verbosity == 0:
console.print(Traceback.from_exception(type(e), e, None))
unwanted_module_names.append("flytekit")
tb = e.__cause__.__traceback__ if e.__cause__ else e.__traceback__
new_tb = remove_unwanted_traceback_frames(tb, unwanted_module_names)
console.print(Traceback.from_exception(type(e), e, new_tb))
elif verbosity == 1:
unwanted_module_names = ["importlib", "click", "rich_click"]
click.secho(
f"Frames from the following modules were removed from the traceback: {unwanted_module_names}."
f" For more verbose output, use the flags -vv or -vvv.",
Expand Down

0 comments on commit c5cc389

Please sign in to comment.