Skip to content

Commit

Permalink
Update rpc_server_interceptor.go (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
cubxxw authored Jan 24, 2024
1 parent b28f3c4 commit 7aa4042
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mw/rpc_server_interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ package mw
import (
"context"
"fmt"
"github.com/OpenIMSDK/tools/checker"
"math"

"github.com/OpenIMSDK/tools/checker"

"github.com/OpenIMSDK/protocol/constant"

"google.golang.org/grpc"
Expand Down Expand Up @@ -119,8 +120,8 @@ func RpcServerInterceptor(
codeErr = errs.ErrInternalServer
}
code := codeErr.Code()
if code <= 0 || code > math.MaxUint32 {
log.ZError(ctx, "rpc UnknownError", err, "rpc UnknownCode:", code)
if code <= 0 || int64(code) > int64(math.MaxUint32) {
log.ZError(ctx, "rpc UnknownError", err, "rpc UnknownCode:", int64(code))
code = errs.ServerInternalError
}
grpcStatus := status.New(codes.Code(code), codeErr.Msg())
Expand Down

0 comments on commit 7aa4042

Please sign in to comment.