|
|
@ -35,7 +35,7 @@ func rpcServerInterceptor(ctx context.Context, req interface{}, info *grpc.Unary
|
|
|
|
log.ZError(ctx, "rpc panic", nil, "FullMethod", info.FullMethod, "type:", fmt.Sprintf("%T", r), "panic:", r)
|
|
|
|
log.ZError(ctx, "rpc panic", nil, "FullMethod", info.FullMethod, "type:", fmt.Sprintf("%T", r), "panic:", r)
|
|
|
|
fmt.Println("stack info:", string(debug.Stack()))
|
|
|
|
fmt.Println("stack info:", string(debug.Stack()))
|
|
|
|
pc, file, line, ok := runtime.Caller(4)
|
|
|
|
pc, file, line, ok := runtime.Caller(4)
|
|
|
|
if ok {
|
|
|
|
if !ok {
|
|
|
|
panic("get runtime.Caller failed")
|
|
|
|
panic("get runtime.Caller failed")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
errInfo := &errinfo.ErrorInfo{
|
|
|
|
errInfo := &errinfo.ErrorInfo{
|
|
|
@ -45,9 +45,9 @@ func rpcServerInterceptor(ctx context.Context, req interface{}, info *grpc.Unary
|
|
|
|
Cause: fmt.Sprintf("%s", r),
|
|
|
|
Cause: fmt.Sprintf("%s", r),
|
|
|
|
Warp: nil,
|
|
|
|
Warp: nil,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
sta, err := status.New(codes.Code(errs.ErrInternalServer.Code()), errs.ErrInternalServer.Msg()).WithDetails(errInfo)
|
|
|
|
sta, err_ := status.New(codes.Code(errs.ErrInternalServer.Code()), errs.ErrInternalServer.Msg()).WithDetails(errInfo)
|
|
|
|
if err != nil {
|
|
|
|
if err_ != nil {
|
|
|
|
panic(err)
|
|
|
|
panic(err_)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
err = sta.Err()
|
|
|
|
err = sta.Err()
|
|
|
|
}
|
|
|
|
}
|
|
|
|