Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always print traceback #2963

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions flytekit/clis/sdk_in_container/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ def pretty_print_grpc_error(e: grpc.RpcError):
if isinstance(e, grpc._channel._InactiveRpcError): # noqa
click.secho(f"RPC Failed, with Status: {e.code()}", fg="red", bold=True)
click.secho(f"\tDetails: {e.details()}", fg="magenta", bold=True)
return
else:
click.secho(f"RPC Failed, with Error: {e}", fg="red", bold=True)


def remove_unwanted_traceback_frames(
Expand Down Expand Up @@ -161,19 +162,11 @@ def pretty_print_exception(e: Exception, verbosity: int = 1):
if isinstance(e, FlyteException):
if isinstance(e, FlyteInvalidInputException):
click.secho("Request rejected by the API, due to Invalid input.", fg="red")
cause = e.__cause__
if cause:
if isinstance(cause, grpc.RpcError):
pretty_print_grpc_error(cause)
else:
pretty_print_traceback(e, verbosity)
else:
pretty_print_traceback(e, verbosity)
return
if e.__cause__ and isinstance(e.__cause__, grpc.RpcError):
pretty_print_grpc_error(e.__cause__)

if isinstance(e, grpc.RpcError):
pretty_print_grpc_error(e)
return

pretty_print_traceback(e, verbosity)

Expand Down
Loading