Skip to content

Commit

Permalink
Fixes Grpc call canceled by client - not a failure #81
Browse files Browse the repository at this point in the history
  • Loading branch information
Enkidu93 committed Sep 27, 2023
1 parent 1055c05 commit ee4df3b
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ public OperationCancelledExceptionFilter(ILoggerFactory loggerFactory)

public override void OnException(ExceptionContext context)
{
if (context.Exception is OperationCanceledException)
if (
context.Exception is OperationCanceledException
|| context.Exception is RpcException rpcEx && rpcEx.StatusCode == StatusCode.Cancelled
)
{
_logger.LogInformation("Request was cancelled");
context.ExceptionHandled = true;
Expand Down

0 comments on commit ee4df3b

Please sign in to comment.