Skip to content

Commit

Permalink
error message changes
Browse files Browse the repository at this point in the history
  • Loading branch information
onkarvhanumante committed Sep 11, 2023
1 parent 8a54873 commit 049354b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions usersync/syncersbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@ func chooseSyncerConfig(biddersSyncerConfig []namedSyncerConfig) (namedSyncerCon
// check if alias bidders of different parent have same syncer key
if len(parentBidderNameMap) > 1 {
sort.Strings(aliasBidderNames)
return namedSyncerConfig{}, fmt.Errorf("alias bidders %s of different parents defines endpoints (iframe and/or redirect) for the same syncer key, but only one bidder is permitted to define endpoints", strings.Join(aliasBidderNames, ", "))
return namedSyncerConfig{}, fmt.Errorf("either alias bidders %s defines endpoints (iframe and/or redirect) for the same syncer key used by multiple bidders, but only one bidder is permitted to define endpoints", strings.Join(aliasBidderNames, ", "))
}

// check if aliases of same parent and non-alias bidder have same syncer key
if _, ok := parentBidderNameMap[nonAliasBidderNames[0]]; !ok {
sort.Strings(aliasBidderNames)
return namedSyncerConfig{}, fmt.Errorf("alias bidders %s and non-alias bidder %s defines endpoints (iframe and/or redirect) for the same syncer key, but only one bidder is permitted to define endpoints", strings.Join(aliasBidderNames, ", "), nonAliasBidderNames[0])
return namedSyncerConfig{}, fmt.Errorf("either alias bidders %s defines endpoints (iframe and/or redirect) for the same syncer key used by other bidder, but only one bidder is permitted to define endpoints", strings.Join(aliasBidderNames, ", "))
}
}

Expand Down
4 changes: 2 additions & 2 deletions usersync/syncersbuilder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ func TestChooseSyncerConfig(t *testing.T) {
{
description: "alias-of-differnt-parent-cannot-have-same-key",
given: []namedSyncerConfig{alias1, alias2},
expectedError: "alias bidders alias-1, alias-2 of different parents defines endpoints (iframe and/or redirect) for the same syncer key, but only one bidder is permitted to define endpoints",
expectedError: "either alias bidders alias-1, alias-2 defines endpoints (iframe and/or redirect) for the same syncer key used by multiple bidders, but only one bidder is permitted to define endpoints",
},
{
description: "non-alias-bidders-cannot-have-same-key",
Expand All @@ -349,7 +349,7 @@ func TestChooseSyncerConfig(t *testing.T) {
{
description: "non-alias-and-aliases-of-same-parent-cannot-have-same-key",
given: []namedSyncerConfig{parent1, alias2, alias3},
expectedError: "alias bidders alias-2, alias-3 and non-alias bidder parent-1 defines endpoints (iframe and/or redirect) for the same syncer key, but only one bidder is permitted to define endpoints",
expectedError: "either alias bidders alias-2, alias-3 defines endpoints (iframe and/or redirect) for the same syncer key used by other bidder, but only one bidder is permitted to define endpoints",
},
}

Expand Down

0 comments on commit 049354b

Please sign in to comment.