Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Su <[email protected]>
  • Loading branch information
pingsutw committed Aug 12, 2024
1 parent 33b53dd commit 89e61cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions flytekit/bin/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,8 @@ def get_traceback_str(e: Exception) -> str:
tb = e.__cause__.__traceback__ if e.__cause__ else e.__traceback__
lines = traceback.format_tb(tb)
lines = [line.rstrip() for line in lines]
lines = "\n".join(lines).split("\n")
tb_str = "\n ".join([""] + lines)
format_str = "Traceback (most recent call last):\n" "{traceback}\n" "\n" "Message:\n" "\n" " {message}"
tb_str = "\n ".join(lines)
format_str = "Traceback (most recent call last):\n" "\n {traceback}\n" "\n" "Message:\n" "\n" " {message}"

value = e.value if isinstance(e, FlyteUserRuntimeException) else e
return format_str.format(traceback=tb_str, message=f"{type(value)}: {value}")
Expand Down
2 changes: 1 addition & 1 deletion flytekit/exceptions/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(self, exc_value):
@param exc_value: The exception that was raised from user code.
"""
self._exc_value = exc_value
super(FlyteUserRuntimeException, self).__init__(str(exc_value))
super().__init__(str(exc_value))

@property
def value(self):
Expand Down

0 comments on commit 89e61cc

Please sign in to comment.