Skip to content

Commit a07e842

Browse files
committed
tweak release notes; try to make CI happy
1 parent 703cc14 commit a07e842

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

docs/releasenotes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## unreleased
44

5-
- add [`[SimpleRpcExceptions]`](https://github.com/protobuf-net/protobuf-net.Grpc/blob/main/src/protobuf-net.Grpc/Configuration/SimpleRpcExceptionsAttribute.cs) which can be applied at service contract, service type, or service method levels, and which exposes exceptions more directly
5+
- add `[SimpleRpcExceptions]` (which can be applied at service contract, service type, or service method levels), and `SimpleRpcExceptionsInterceptor` (which can be applied to any service registration) - which expose server exceptions more conveniently (#75)
66

77
## 1.0.90
88

src/protobuf-net.Grpc/Configuration/SimpleRpcExceptionsInterceptor.cs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,20 @@ public override async Task<TResponse> UnaryServerHandler<TRequest, TResponse>(TR
8282

8383
internal static void RethrowAsRpcException(Exception ex)
8484
{
85+
#pragma warning disable IDE0059 // needs more recent compiler than the CI server has
8586
var code = ex switch
8687
{
87-
OperationCanceledException => StatusCode.Cancelled,
88-
ArgumentException => StatusCode.InvalidArgument,
89-
NotImplementedException => StatusCode.Unimplemented,
90-
SecurityException => StatusCode.PermissionDenied,
91-
EndOfStreamException => StatusCode.OutOfRange,
92-
FileNotFoundException => StatusCode.NotFound,
93-
DirectoryNotFoundException => StatusCode.NotFound,
94-
TimeoutException => StatusCode.DeadlineExceeded,
88+
OperationCanceledException a => StatusCode.Cancelled,
89+
ArgumentException b => StatusCode.InvalidArgument,
90+
NotImplementedException c => StatusCode.Unimplemented,
91+
SecurityException d => StatusCode.PermissionDenied,
92+
EndOfStreamException e => StatusCode.OutOfRange,
93+
FileNotFoundException f => StatusCode.NotFound,
94+
DirectoryNotFoundException g => StatusCode.NotFound,
95+
TimeoutException h => StatusCode.DeadlineExceeded,
9596
_ => StatusCode.Unknown,
9697
};
98+
#pragma warning restore IDE0059 // needs more recent compiler than the CI server has
9799
throw new RpcException(new Status(code, ex.Message), ex.Message);
98100
}
99101
}

0 commit comments

Comments
 (0)