From 0a5dfc652f42782bab91796110390c038bca7cab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Sibiril?= <81782+aureliensibiril@users.noreply.github.com> Date: Thu, 16 Apr 2026 12:28:19 +0200 Subject: [PATCH] Use typed error when SCIM bridge is not found MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit UpdateSCIMBridge returned bare fmt.Errorf("SCIM bridge not found") strings on the two not-found branches (resource missing, and cross-tenant mismatch). Every other call site returning the same condition uses the typed NewSCIMBridgeNotFoundError(bridgeID) (see lines 1962 and 2153 in this file). Switch both branches to the typed error so the error shape is consistent across the service and callers can use errors.As to detect the condition. Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com> --- pkg/iam/organization_service.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/iam/organization_service.go b/pkg/iam/organization_service.go index b77547b96..0c2f632d3 100644 --- a/pkg/iam/organization_service.go +++ b/pkg/iam/organization_service.go @@ -1670,14 +1670,14 @@ func (s OrganizationService) UpdateSCIMBridge( err := bridge.LoadByID(ctx, tx, scope, bridgeID) if err != nil { if err == coredata.ErrResourceNotFound { - return fmt.Errorf("SCIM bridge not found") + return NewSCIMBridgeNotFoundError(bridgeID) } return fmt.Errorf("cannot load SCIM bridge: %w", err) } if bridge.OrganizationID != organizationID { - return fmt.Errorf("SCIM bridge not found") + return NewSCIMBridgeNotFoundError(bridgeID) } bridge.ExcludedUserNames = excludedUserNames