-
Notifications
You must be signed in to change notification settings - Fork 749
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
RpcException API improvements #1992
RpcException API improvements #1992
Conversation
src/Grpc.Core.Api/Status.cs
Outdated
@@ -88,7 +88,8 @@ public override string ToString() | |||
{ | |||
if (DebugException != null) | |||
{ | |||
return $"Status(StatusCode=\"{StatusCode}\", Detail=\"{Detail}\", DebugException=\"{DebugException}\")"; | |||
return $"Status(StatusCode=\"{StatusCode}\", Detail=\"{Detail}\"," + | |||
$" DebugException=\"{DebugException.GetType().Name}: {DebugException.Message}\")"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a slightly odd choice to show the type name - especially as concrete exception types are often internal, but: not invalid - just me adding a "are you 100% sure you want this?" check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Showing the type name is normal in Exception.ToString()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor thought added re text; but: I wholeheartedly support the change (and populating the inner exception), 👍
src/Grpc.Core.Api/Status.cs
Outdated
@@ -88,7 +88,8 @@ public override string ToString() | |||
{ | |||
if (DebugException != null) | |||
{ | |||
return $"Status(StatusCode=\"{StatusCode}\", Detail=\"{Detail}\", DebugException=\"{DebugException}\")"; | |||
return $"Status(StatusCode=\"{StatusCode}\", Detail=\"{Detail}\"," + | |||
$" DebugException=\"{DebugException.GetType().Name}: {DebugException.Message}\")"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Showing the type name is normal in Exception.ToString()
Co-authored-by: James Newton-King <james@newtonking.com>
Addresses grpc/grpc#27066 and grpc/grpc#25740 (in a backward compatible way).
Two options for addressing the problem in Grpc.Core as well: