Error management
In the basics section of gRPC, we briefly covered errors the different error codes a server can respond with. In gRPC, error codes are helpful for indicating what exactly happened, whether it be success or failure. But there are times where more than just “not found” needs to be reported back to a calling client.
For example, if you’re attempting to create a resource inside of a server, and that server decides that the input on the request is invalid (a malformed email for example), it may need to include more information back to the client to make the appropriate decision other than “invalid data.”
Using the malformed email as an example case, a client may want to display to the user attempting to create an account that the email is invalid. After all, the user wouldn’t like if the page only displayed “invalid data.” Instead, a helpful error message would be nice so they can act on the field that was invalid.
gRPC...