From 03d77c3babe92ba19fdec9ba1a09b5ff5d3357fb Mon Sep 17 00:00:00 2001 From: Sacha Al Himdani Date: Fri, 27 Mar 2026 16:20:16 +0100 Subject: [PATCH] Fix duplicate organization name returning internal error When creating an organization with a name that produces a duplicate trust center slug, the API now returns a Conflict response instead of a generic Internal error. Signed-off-by: Sacha Al Himdani --- pkg/server/api/connect/v1/v1_resolver.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/server/api/connect/v1/v1_resolver.go b/pkg/server/api/connect/v1/v1_resolver.go index 64fef54d8..23d6b6b6e 100644 --- a/pkg/server/api/connect/v1/v1_resolver.go +++ b/pkg/server/api/connect/v1/v1_resolver.go @@ -779,6 +779,10 @@ func (r *mutationResolver) CreateOrganization(ctx context.Context, input types.C }, ) if err != nil { + if errors.Is(err, coredata.ErrResourceAlreadyExists) { + return nil, gqlutils.Conflict(ctx, err) + } + r.logger.ErrorCtx(ctx, "cannot create organization", log.Error(err)) return nil, gqlutils.Internal(ctx) }