mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-08 02:55:58 +08:00
Merge remote-tracking branch 'origin/main' into add-new-feature-#484
# Conflicts: # pkg/common/db/unrelation/extend_msg.go
This commit is contained in:
@@ -31,7 +31,7 @@ import (
|
||||
)
|
||||
|
||||
func GrpcClient() grpc.DialOption {
|
||||
return grpc.WithUnaryInterceptor(RpcClientInterceptor)
|
||||
return grpc.WithChainUnaryInterceptor(RpcClientInterceptor)
|
||||
}
|
||||
|
||||
func RpcClientInterceptor(
|
||||
|
||||
@@ -52,7 +52,6 @@ func RpcServerInterceptor(
|
||||
handler grpc.UnaryHandler,
|
||||
) (resp interface{}, err error) {
|
||||
log.ZDebug(ctx, "rpc server req", "req", rpcString(req))
|
||||
|
||||
//defer func() {
|
||||
// if r := recover(); r != nil {
|
||||
// log.ZError(ctx, "rpc panic", nil, "FullMethod", info.FullMethod, "type:", fmt.Sprintf("%T", r), "panic:", r)
|
||||
@@ -177,12 +176,13 @@ func RpcServerInterceptor(
|
||||
}
|
||||
details, err := grpcStatus.WithDetails(errInfo)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
log.ZWarn(ctx, "rpc server resp WithDetails error", err, "funcName", funcName)
|
||||
return nil, errs.Wrap(err)
|
||||
}
|
||||
log.ZWarn(ctx, "rpc server resp", err, "funcName", funcName)
|
||||
return nil, details.Err()
|
||||
}
|
||||
|
||||
func GrpcServer() grpc.ServerOption {
|
||||
return grpc.UnaryInterceptor(RpcServerInterceptor)
|
||||
return grpc.ChainUnaryInterceptor(RpcServerInterceptor)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user