grpc-node/examples/error_handling
Michael Lumish 0ebfe60bf2 Add error handling example 2023-09-26 09:46:56 -07:00
..
README.md Add error handling example 2023-09-26 09:46:56 -07:00
client.js Add error handling example 2023-09-26 09:46:56 -07:00
server.js Add error handling example 2023-09-26 09:46:56 -07:00

README.md

Error Handling

This example demonstrates basic RPC error handling in gRPC for unary and streaming response cardinalities.

Start the server

Run the server, whcih returns an error if the RPC request's name field is empty.

node server.js

Run the client

Then run the client in another terminal, which makes two requests for each of unary and streaming responses: one with an empty Name field and one with it populated with the current username provided by os/user.

node client.js