Skip to content

Commit

Permalink
Change error responde code if a whitelisted domain already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
begelundmuller committed Aug 29, 2024
1 parent 1bd7671 commit 0d339f5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions admin/server/organizations.go
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,9 @@ func (s *Server) CreateWhitelistedDomain(ctx context.Context, req *adminv1.Creat
Domain: req.Domain,
})
if err != nil {
if errors.Is(err, database.ErrNotUnique) {
return nil, status.Errorf(codes.AlreadyExists, err.Error())
}
return nil, status.Error(codes.Internal, err.Error())
}

Expand Down

0 comments on commit 0d339f5

Please sign in to comment.