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

Include traceback in errors from admin #1621

Merged
merged 3 commits into from
May 8, 2023
Merged
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
9 changes: 4 additions & 5 deletions flytekit/clis/sdk_in_container/pyflyte.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ def validate_package(ctx, param, values):

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")
click.secho(f"\tdetails: {e.details()}", fg="magenta")
click.secho(f"RPC Failed, with Status: {e.code()}", fg="red", bold=True)
click.secho(f"\tdetails: {e.details()}", fg="magenta", bold=True)
click.secho(f"\tDebug string {e.debug_error_string()}", dim=True)
return

Expand All @@ -53,12 +53,11 @@ def pretty_print_exception(e: Exception):
raise e

if isinstance(e, FlyteException):
click.secho(f"Failed with Exception Code: {e._ERROR_CODE}", fg="red") # noqa
if isinstance(e, FlyteInvalidInputException):
click.secho("Request rejected by the API, due to Invalid input.", fg="red")
click.secho(f"\tReason: {str(e)}", dim=True)
click.secho(f"\tInput Request: {MessageToJson(e.request)}", dim=True)
return
click.secho(f"Failed with Exception: Reason: {e._ERROR_CODE}", fg="red") # noqa

cause = e.__cause__
if cause:
if isinstance(cause, grpc.RpcError):
Expand Down