This library contains the following components:
- Global error handlers
Any exception on the server side is converted to an inner exception in RpcException with a populated Message field.
On the server side:
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddGrpcServer();
var app = builder.Build();
app.MapGrpcEndpoints<TestService>();
app.Run();
On the client side:
var grpcChannel = GrpcChannel.ForAddress(client.BaseAddress!, new GrpcChannelOptions
{
HttpClient = client,
});
var callInvoker = grpcChannel.Intercept(new GrpcClientExceptionInterceptor());
callInvoker.CreateGrpcService<T>();