I want to have an interceptor for grpc in c# .net core to check all request credentials and log all rpc exception but if Continuation method calls without Await key word its exception doesn't throw in this level. so I await for continuation in interceptor to catch all excetions. All things work well so far, but I don't know if it may cause any problem later specially in multiple cincurrent rpc calls?
public override async Task<TResponse> UnaryServerHandler<TRequest, TResponse>(TRequest request, ServerCallContext context, UnaryServerMethod<TRequest, TResponse> continuation)
{
try
{
CheckLogin(context);
var res = await continuation(request, context);
return res;
}
catch (RpcException ex)
{
_logger.LogError(ex, "RPC Error. UnaryServerHanler Error. Method : {method}", context.Method);
throw ex;
}
catch (Exception ex)
{
_logger.LogError(ex, "UnaryServerHanler Error. Method : {method}", context.Method);
throw ex;
}
}