From ee4df3bb6e2b5d2dde5bc95f4da0a0da0146e219 Mon Sep 17 00:00:00 2001 From: Enkidu93 Date: Wed, 27 Sep 2023 16:44:34 -0400 Subject: [PATCH] Fixes Grpc call canceled by client - not a failure #81 --- .../Controllers/OperationCancelledExceptionFilter.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Serval.Shared/Controllers/OperationCancelledExceptionFilter.cs b/src/Serval.Shared/Controllers/OperationCancelledExceptionFilter.cs index 82b40c3e..72552494 100644 --- a/src/Serval.Shared/Controllers/OperationCancelledExceptionFilter.cs +++ b/src/Serval.Shared/Controllers/OperationCancelledExceptionFilter.cs @@ -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;