Commit 4ce76723 authored by Andrei Mihu's avatar Andrei Mihu
Browse files

Correct error code for group creation name conflicts.

parent 7757b253
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr
## [Unreleased]
### Changed
- Default runtime HTTP key value is no longer the same as the default Server key value.
- Group create now returns HTTP 409 Conflict/GRPC Code 6 when group name is already in use.

## [2.7.0] - 2019-09-11
### Added
+1 −1
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ func (s *ApiServer) CreateGroup(ctx context.Context, in *api.CreateGroupRequest)
	group, err := CreateGroup(ctx, s.logger, s.db, userID, userID, in.GetName(), in.GetLangTag(), in.GetDescription(), in.GetAvatarUrl(), "", in.GetOpen(), maxCount)
	if err != nil {
		if err == ErrGroupNameInUse {
			return nil, status.Error(codes.InvalidArgument, "Group name is in use.")
			return nil, status.Error(codes.AlreadyExists, "Group name is in use.")
		}
		return nil, status.Error(codes.Internal, "Error while trying to create group.")
	}