Enable this plugin to capture panics at the entry point of requests and return a 500 response, preventing program crashes caused by panics.
In general, this plugin should be configured as the first item in the filter configuration.
Import this plugin in your code.
import (
_ "trpc.group/trpc-go/trpc-filter/recovery"
)
Configure the trpc-go framework. In the server's filter configuration, enable the recovery interceptor as follows:
server:
...
filter:
- recovery
...