Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions config/bidderinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -464,17 +464,17 @@ func validateAliases(aliasBidderInfo BidderInfo, infos BidderInfos, bidderName s
}

if aliasBidderInfo.WhiteLabelOnly {
return fmt.Errorf("bidder: %s is an alias and cannot be set as white label only", bidderName)
return fmt.Errorf("bidder '%s' is an alias and cannot be set as white label only", bidderName)
}

parentBidder, parentBidderFound := infos[aliasBidderInfo.AliasOf]

if !parentBidderFound {
return fmt.Errorf("bidder: %s not found for an alias: %s", aliasBidderInfo.AliasOf, bidderName)
return fmt.Errorf("alias '%s' references a nonexistent bidder '%s'", bidderName, aliasBidderInfo.AliasOf)
}

if len(parentBidder.AliasOf) > 0 {
return fmt.Errorf("bidder: %s cannot be an alias of an alias: %s", aliasBidderInfo.AliasOf, bidderName)
return fmt.Errorf("alias '%s' cannot reference another alias '%s'", bidderName, aliasBidderInfo.AliasOf)
}

return nil
Expand Down
8 changes: 4 additions & 4 deletions config/bidderinfo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ func TestProcessAliasBidderInfo(t *testing.T) {
AliasOf: "bidderA",
},
},
expectedErr: errors.New("bidder: bidderA not found for an alias: bidderB"),
expectedErr: errors.New("alias 'bidderB' references a nonexistent bidder 'bidderA'"),
},
{
description: "bidder info not found for an alias",
Expand Down Expand Up @@ -698,21 +698,21 @@ func TestValidateAliases(t *testing.T) {
bidderName: "b",
bidderInfo: BidderInfo{AliasOf: "nonexistent"},
bidderInfos: BidderInfos{},
expectedErr: errors.New("bidder: nonexistent not found for an alias: b"), // does this make sense? should it be reversed?
expectedErr: errors.New("alias 'b' references a nonexistent bidder 'nonexistent'"),
},
{
name: "alias-of-alias",
bidderName: "b",
bidderInfo: BidderInfo{AliasOf: "a"},
bidderInfos: BidderInfos{"a": BidderInfo{AliasOf: "foo"}},
expectedErr: errors.New("bidder: a cannot be an alias of an alias: b"), // does this make sense? should it be reversed?
expectedErr: errors.New("alias 'b' cannot reference another alias 'a'"),
},
{
name: "whitelabelonly",
bidderName: "b",
bidderInfo: BidderInfo{AliasOf: "a", WhiteLabelOnly: true},
bidderInfos: BidderInfos{"a": BidderInfo{}},
expectedErr: errors.New("bidder: b is an alias and cannot be set as white label only"),
expectedErr: errors.New("bidder 'b' is an alias and cannot be set as white label only"),
},
}

Expand Down
Loading