When there is no data in mongodb, the program currently throws an exception directly. I suggest that the normal situation is to return the information through error.
2024/01/27 17:48:29 Query: db.order.Find.One.conds(map[orderId:1046505705])
Stack:
fmt.(pp).handleMethods@C:/Program Files/Go/src/fmt/print.go:673
fmt.(pp).printArg@C:/Program Files/Go/src/fmt/print.go:756
fmt.(pp).doPrint@C:/Program Files/Go/src/fmt/print.go:1211
fmt.Append@C:/Program Files/Go/src/fmt/print.go:289
log.(Logger).Print.func1@C:/Program Files/Go/src/log/log.go:261
log.(Logger).output@C:/Program Files/Go/src/log/log.go:238
log.(Logger).Print@C:/Program Files/Go/src/log/log.go:260
ggrpc/data/order.(Order).FindOrder@C:/glkj/golang/ggprc/data/order/order.go:65
ggrpc/server/order.(Order).PushOrder@C:/glkj/golang/ggprc/server/order/order.go:18
ggrpc/proto/order._Order_PushOrder_Handler.func1@C:/glkj/golang/ggprc/proto/order/order_grpc.pb.go:86
ggrpc/server.unaryInterceptor@C:/glkj/golang/ggprc/server/register.go:59
ggrpc/proto/order._Order_PushOrder_Handler@C:/glkj/golang/ggprc/proto/order/order_grpc.pb.go:88
google.golang.org/grpc.(Server).processUnaryRPC@C:/Users/Administrator/go/pkg/mod/google.golang.org/grpc@v1.58.0/server.go:1376
google.golang.org/grpc.(Server).handleStream@C:/Users/Administrator/go/pkg/mod/google.golang.org/grpc@v1.58.0/server.go:1753
google.golang.org/grpc.(*Server).serveStreams.func1.1@C:/Users/Administrator/go/pkg/mod/google.golang.org/grpc@v1.58.0/server.go:998
runtime.goexit@C:/Program Files/Go/src/runtime/asm_amd64.s:1650
Error: not found
Time taken: 0.00117s
When there is no data in mongodb, the program currently throws an exception directly. I suggest that the normal situation is to return the information through error. 2024/01/27 17:48:29 Query: db.order.Find.One.conds(map[orderId:1046505705]) Stack: fmt.(pp).handleMethods@C:/Program Files/Go/src/fmt/print.go:673 fmt.(pp).printArg@C:/Program Files/Go/src/fmt/print.go:756 fmt.(pp).doPrint@C:/Program Files/Go/src/fmt/print.go:1211 fmt.Append@C:/Program Files/Go/src/fmt/print.go:289 log.(Logger).Print.func1@C:/Program Files/Go/src/log/log.go:261 log.(Logger).output@C:/Program Files/Go/src/log/log.go:238 log.(Logger).Print@C:/Program Files/Go/src/log/log.go:260 ggrpc/data/order.(Order).FindOrder@C:/glkj/golang/ggprc/data/order/order.go:65 ggrpc/server/order.(Order).PushOrder@C:/glkj/golang/ggprc/server/order/order.go:18 ggrpc/proto/order._Order_PushOrder_Handler.func1@C:/glkj/golang/ggprc/proto/order/order_grpc.pb.go:86 ggrpc/server.unaryInterceptor@C:/glkj/golang/ggprc/server/register.go:59 ggrpc/proto/order._Order_PushOrder_Handler@C:/glkj/golang/ggprc/proto/order/order_grpc.pb.go:88 google.golang.org/grpc.(Server).processUnaryRPC@C:/Users/Administrator/go/pkg/mod/google.golang.org/grpc@v1.58.0/server.go:1376 google.golang.org/grpc.(Server).handleStream@C:/Users/Administrator/go/pkg/mod/google.golang.org/grpc@v1.58.0/server.go:1753 google.golang.org/grpc.(*Server).serveStreams.func1.1@C:/Users/Administrator/go/pkg/mod/google.golang.org/grpc@v1.58.0/server.go:998 runtime.goexit@C:/Program Files/Go/src/runtime/asm_amd64.s:1650 Error: not found Time taken: 0.00117s