cloudwego / volo

Rust RPC framework with high-performance and strong-extensibility for building micro-services.
https://crates.io/crates/volo
Apache License 2.0
2.13k stars 166 forks source link

feat: support catch panic in service #445

Closed PureWhiteWu closed 3 weeks ago

PureWhiteWu commented 4 weeks ago

Motivation

Catch panic and handle it is a common need for both http and thrift users.

Solution

This PR implements a Service which catches panics and provides a Handler trait for users to handle the panic.

There's also an example Handler implementation in volo-thrift::server:panic_handler.