You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What version of gRPC and what language are you using?
2.32.0
What operating system (Linux, Windows,...) and version?
Windows 10
What runtime / compiler are you using (e.g. .NET Core SDK version dotnet --info)
.NET Core SDK: Version: 3.1.402
What did you do?
I'm working on error handling. I want to detect when service is unavailable.
I've noticed that when I'm using Grpc.Core.Channel everything is ok - status code of RpcException is equal to Unavailable (correct).
But when I'm using Grpc.Net.Client.GrpcChannel status code of RpcException is equal to Internal (incorrect).
Below test that presents the issue:
[Test]publicvoidWrong_status_code(){vargrpcCLibChannel=newChannel("localhost",port,ChannelCredentials.Insecure);vargrpcCLibClient=newTestService.TestServiceClient(grpcCLibChannel);varexceptionCLib=Assert.ThrowsAsync<RpcException>(async()=>awaitgrpcCLibClient.TestMethodAsync(newTestModelInput()));TestContext.WriteLine(exceptionCLib);Assert.That(exceptionCLib.Status.StatusCode,Is.EqualTo(StatusCode.Unavailable));varuri=newUriBuilder("http","localhost",port).Uri;varoptions=newGrpcChannelOptions(){Credentials=ChannelCredentials.Insecure};vargrpcCSharpHttpClientChannel=GrpcChannel.ForAddress(uri,options);vargrpcCSharpHttpClientClient=newTestService.TestServiceClient(grpcCSharpHttpClientChannel);varexceptionCSharpHttpClient=Assert.ThrowsAsync<RpcException>(async()=>awaitgrpcCSharpHttpClientClient.TestMethodAsync(newTestModelInput()));TestContext.WriteLine(exceptionCSharpHttpClient);Assert.That(exceptionCSharpHttpClient.Status.StatusCode,Is.EqualTo(StatusCode.Internal));// <--- !!!! should be Unavailable}
The same issue exists when client is created by DI in ASP.NET Core (registered with extension: service.AddGrpcClient<T>)
I can detect that connection is unavailable based on exceptionCSharpHttpClient .Status.DebugException (which has HttpRequestException type) but the docs say that DebugException shouldn't be used in logic.
What did you expect to see?
RpcException should have status equal to Unavailable.
What did you see instead?
RpcException had status equal to Internal when Grpc.Net.Client.GrpcChannel was used.
The text was updated successfully, but these errors were encountered:
What version of gRPC and what language are you using?
2.32.0
What operating system (Linux, Windows,...) and version?
Windows 10
What runtime / compiler are you using (e.g. .NET Core SDK version
dotnet --info
).NET Core SDK: Version: 3.1.402
What did you do?
I'm working on error handling. I want to detect when service is unavailable.
I've noticed that when I'm using
Grpc.Core.Channel
everything is ok - status code ofRpcException
is equal to Unavailable (correct).But when I'm using
Grpc.Net.Client.GrpcChannel
status code ofRpcException
is equal to Internal (incorrect).Below test that presents the issue:
The same issue exists when client is created by DI in ASP.NET Core (registered with extension:
service.AddGrpcClient<T>
)I can detect that connection is unavailable based on
exceptionCSharpHttpClient .Status.DebugException
(which hasHttpRequestException
type) but the docs say that DebugException shouldn't be used in logic.What did you expect to see?
RpcException
should have status equal to Unavailable.What did you see instead?
RpcException
had status equal toInternal
whenGrpc.Net.Client.GrpcChannel
was used.The text was updated successfully, but these errors were encountered: