dyweb / blog

Dongyue Tech Blog
https://blog.dongyueweb.com
14 stars 7 forks source link

[post] Error handling in go, rust, java, cpp and gRPC #57

Open at15 opened 4 years ago

at15 commented 4 years ago

Type

Related

Description

NOTE: The draft is in go/pl/doc/error.md

You can't avoid error handling in any programming language (like you can't avoid death and IRS). Although the philosophy and runtime implementation are different (error value, result, exception), there are still many things in common (e.g. wrap, unwrap, multiple errors, custom error type, error in a different thread).

Furthermore, when it comes to a cloud native (or k8s native) micro service architecture, you need to pass error across the wire. Clearly http status code can't meet the complexity of your highly available, multi (hybrid) cloud, global scale, low latency, high throughput, custom json to yaml converter. A well defined interface error format is needed, it can be generated from different programming languages, serialized and passed through different rpc frameworks (json, gRPC) and shows the trace across different services, libraries and functions.

The post plans to cover the following

Update