In this video we look at the concepts behind error handling in gRPC Unary RPCs. You will learn the what gRPC errors are and the different patterns needed from RESTful services. You will also learn how to create and return rich error messages with status codes and metadata. In addition to seeing how to return errors from the server we also look at how error messages from Unary RPCs can be handled in the client.

In the next episode we take this one step further and start to look at gRPC error messages from streaming RPCs.

Contents:
0:00 Introduction and difference between RESTful services
2:15 Returning errors from Unary RPCs
3:40 Rich error messages with gRPC Status (https://godoc.org/google.golang.org/g…)
6:35 Adding metadata to error messages
10:00 Example of gRPC errors returned from a Unary RPC
12:20 Handling error messages in gRPC clients
17:20 Using gRPC error codes to create rich client errors

gRPC Errors Core Concepts: https://grpc.io/docs/what-is-grpc/core-concepts/

Source Code: https://github.com/nicholasjackson/building-microservices-youtube/tree/episode_18

#go #golang

Building Microservices with Go: gRPC Error messages in Unary RPCs
8.30 GEEK