The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#) https://grpc.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Esun Kim f3574e3f64
[Example] Adding error_handling & error_details example (#33129)
2 years ago
..
BUILD [Example] Adding error_handling & error_details example (#33129) 2 years ago
CMakeLists.txt [Example] Adding error_handling & error_details example (#33129) 2 years ago
README.md [Example] Adding error_handling & error_details example (#33129) 2 years ago
greeter_client.cc [Example] Adding error_handling & error_details example (#33129) 2 years ago
greeter_server.cc [Example] Adding error_handling & error_details example (#33129) 2 years ago

README.md

Error Handling Example

Overview

This example shows you how to return error from the server and how to handle it on the client.

Try it!

Once you have working gRPC, you can build this example using either bazel or cmake.

Run the server, which will listen on port 50051:

$ ./greeter_server

Run the client (in a different terminal):

$ ./greeter_client

If things go smoothly, you will see the client output:

### Send: SayHello(name=)
Failed. Code=3 Message=Length of `Name` should be between 1 and 10
### Send: SayHello(name=ItsTooLongName)
Failed. Code=3 Message=Length of `Name` should be between 1 and 10
### Send: SayHello(name=World)
Ok. ReplyMessage=Hello World