icerpc / icerpc-csharp

A C# RPC framework built for QUIC, with bidirectional streaming, first-class async/await, and Protobuf support.
https://docs.icerpc.dev
Apache License 2.0
102 stars 13 forks source link

Add custom error example (showcases Result<Success, Failure>) #3889

Closed bernardnormier closed 7 months ago

bernardnormier commented 7 months ago

This PR adds a new Slice example, CustomError.

Sample output: Client

The greeting for '' is EmptyName { }
The greeting for 'jimmy' is Away until 1/24/2024 3:33:17 PM
The greeting for 'billy bob' is NameTooLong { MaxLength = 7 }
The greeting for 'alice' is 'Hello, alice!'
The greeting for 'bernard' is 'Hello, bernard!'

Server

Dispatching greet request { name = '' }
Dispatching greet request { name = 'jimmy' }
Dispatching greet request { name = 'billy bob' }
Dispatching greet request { name = 'alice' }
Dispatching greet request { name = 'bernard' }