Fix 5xx when saml config already exist

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2025-12-24 11:59:42 +01:00
parent 61007559d7
commit 12c7c278ad
4 changed files with 27 additions and 0 deletions

View File

@@ -1069,6 +1069,10 @@ func (s OrganizationService) CreateSAMLConfiguration(
err = config.Insert(ctx, tx, scope)
if err != nil {
if errors.Is(err, coredata.ErrResourceAlreadyExists) {
return NewSAMLConfigurationEmailDomainAlreadyExistsError(req.EmailDomain)
}
return fmt.Errorf("cannot insert saml configuration: %w", err)
}