diff --git a/go.mod b/go.mod index 59b2a6488..ac45b4f44 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( golang.org/x/crypto v0.14.0 golang.org/x/net v0.17.0 google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 - google.golang.org/grpc v1.54.0 + google.golang.org/grpc v1.56.3 google.golang.org/protobuf v1.30.0 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/go.sum b/go.sum index c43110251..260300617 100644 --- a/go.sum +++ b/go.sum @@ -657,8 +657,8 @@ google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.54.0 h1:EhTqbhiYeixwWQtAEZAxmV9MGqcjEU2mFx52xCzNyag= -google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= +google.golang.org/grpc v1.56.3 h1:8I4C0Yq1EjstUzUJzpcRVbuYA2mODtEmpWiQoN/b2nc= +google.golang.org/grpc v1.56.3/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/server/rpc/grpchelper/status.go b/server/rpc/grpchelper/status.go index a75a8a1b3..723f2a49d 100644 --- a/server/rpc/grpchelper/status.go +++ b/server/rpc/grpchelper/status.go @@ -59,6 +59,7 @@ var errorToCode = map[error]codes.Code{ // AlreadyExists means the requested resource already exists. database.ErrProjectAlreadyExists: codes.AlreadyExists, database.ErrProjectNameAlreadyExists: codes.AlreadyExists, + database.ErrUserAlreadyExists: codes.AlreadyExists, // FailedPrecondition means the request is rejected because the state of the // system is not the desired state. diff --git a/server/rpc/server_test.go b/server/rpc/server_test.go index faad247e8..b52e60f5f 100644 --- a/server/rpc/server_test.go +++ b/server/rpc/server_test.go @@ -718,7 +718,7 @@ func TestAdminRPCServerBackend(t *testing.T) { Password: adminPassword, }, ) - assert.Equal(t, codes.Unknown, status.Convert(err).Code()) + assert.Equal(t, codes.AlreadyExists, status.Convert(err).Code()) }) t.Run("admin login test", func(t *testing.T) {