package handler

import (
	"baron-sso-backend/internal/repository"
	"context"
	"log/slog"
)

func markUserProjectionFailed(ctx context.Context, repo repository.UserProjectionRepository, syncErr error) {
	if repo == nil || syncErr == nil {
		return
	}
	if err := repo.MarkFailed(ctx, syncErr); err != nil {
		slog.Error("Failed to mark user projection as failed", "syncError", syncErr, "error", err)
	}
}
