error_handling/

directory
v0.0.0-...-7fb5738 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2025 License: Apache-2.0

README

Description

This example demonstrates basic RPC error handling in gRPC.

Run the sample code

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

$ go run ./server/main.go

Then run the client in another terminal, which does two requests: one with an empty Name field and one with it populated with the current username provided by os/user.

$ go run ./client/main.go

It should print the status codes it received from the server.

Directories

Path Synopsis
Binary client demonstrates how to handle errors returned by a gRPC server.
Binary client demonstrates how to handle errors returned by a gRPC server.
Binary server demonstrates how to return specific error codes in gRPC responses.
Binary server demonstrates how to return specific error codes in gRPC responses.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL