Rename ErrCampaignNoSourcesSelected to ErrCampaignMissingSources

The failure is about unconfigured campaign sources, not an empty UI
selection.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
This commit is contained in:
Cursor Agent
2026-07-20 15:47:27 +00:00
parent eebc957d36
commit eabd0fb659
3 changed files with 3 additions and 3 deletions

View File

@@ -429,7 +429,7 @@ func (s *Service) StartCampaign(
} }
if len(campaignSources) == 0 { if len(campaignSources) == 0 {
return ErrCampaignNoSourcesSelected return ErrCampaignMissingSources
} }
now := time.Now() now := time.Now()

View File

@@ -23,6 +23,6 @@ package accessreview
import "errors" import "errors"
var ( var (
ErrCampaignNoSourcesSelected = errors.New("cannot start campaign: no scope sources configured") ErrCampaignMissingSources = errors.New("cannot start campaign: no scope sources configured")
ErrCampaignNotDraft = errors.New("campaign must be in draft status") ErrCampaignNotDraft = errors.New("campaign must be in draft status")
) )

View File

@@ -805,7 +805,7 @@ func (r *mutationResolver) StartAccessReviewCampaign(ctx context.Context, input
campaign, err := r.accessReview.StartCampaign(ctx, scope, input.AccessReviewCampaignID) campaign, err := r.accessReview.StartCampaign(ctx, scope, input.AccessReviewCampaignID)
if err != nil { if err != nil {
if errors.Is(err, accessreview.ErrCampaignNoSourcesSelected) || if errors.Is(err, accessreview.ErrCampaignMissingSources) ||
errors.Is(err, accessreview.ErrCampaignNotDraft) { errors.Is(err, accessreview.ErrCampaignNotDraft) {
return nil, gqlutils.Invalid(ctx, err) return nil, gqlutils.Invalid(ctx, err)
} }