Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
at15 opened this issue Aug 7, 2020 · 0 comments
Open

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

at15 opened this issue Aug 7, 2020 · 0 comments
Assignees
Labels

Comments

@at15
Copy link
Member

at15 commented Aug 7, 2020

Type

  • request post from @at15

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

  • all the languages
    • error wrapping, context, recovery
    • common errors (in runtime/stdlib)
    • common error libraries
  • go
    • the most basic Error() string
    • the newer go error interface proposal and implementation, errors.Is, fmt.Errof("%w") etc.
    • go error libraries in popular projects (k8s, tidb etc.)
  • rust
    • the ?
  • java
  • different java exceptions (I remember there two kinds, you need to write throws for one of them)
  • cpp
    • the overhead of exception in cpp
  • os
    • cpu exception
    • syscall error
    • kernel error (from user and kernel itself)
  • rpc
    • http status code
    • grpc
      • define detail error instead of just using builtin errors
    • serialize error
    • trace error
    • error collecting services, e.g. Sentry

Update

  • 2020-08-07 20:01 Init
@at15 at15 added area/go area/pl Programming Language area/rust labels Aug 7, 2020
@at15 at15 self-assigned this Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant