Skip to content

PRO TIP Block youtube.com at the DNS level — Pi-hole, NextDNS or your hosts file — but allow youtube-nocookie.com and i.ytimg.com. These tutorials keep playing; the rabbit hole does not.

Learning without distractions

18. gRPC Error messages in Unary RPCs

10.2K views on YouTube

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.

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

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/grpc/status)
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

Series Content:
Over the weeks we will look at the following topics, teaching you everything you need to know regarding building microservices with the go programming language:
– Introduction to microservices
– RESTFul microservices
– gRPC microservices
– Packaging applications with Docker
– Testing microservice
– Continuous Delivery
– Observability
– Using Kubernetes
– Debugging
– Security
– Asynchronous microservices
– Caching
– Microservice reliability using a Service Mesh

Note: All funds raised from advertising in these videos is donated to charity.