Skip to content

Commit 33e1016

Browse files
committed
Move into try block
1 parent 433e849 commit 33e1016

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/roktManager.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,6 @@ export default class RoktManager {
8484
}
8585

8686
public selectPlacements(options: IRoktSelectPlacementsOptions): Promise<IRoktSelection> {
87-
if (this.experimentAllocation) {
88-
options.attributes['rokt.experimentid'] = this.experimentAllocation.experimentId;
89-
options.attributes['rokt.bucketid'] = this.experimentAllocation.bucketId;
90-
options.attributes['rokt.userid'] = this.experimentAllocation.userId;
91-
}
9287

9388
if (!this.isReady()) {
9489
this.queueMessage({
@@ -99,6 +94,11 @@ export default class RoktManager {
9994
}
10095

10196
try {
97+
if (this.experimentAllocation) {
98+
options.attributes['rokt.experimentid'] = this.experimentAllocation.experimentId;
99+
options.attributes['rokt.bucketid'] = this.experimentAllocation.bucketId;
100+
options.attributes['rokt.userid'] = this.experimentAllocation.userId;
101+
}
102102
return this.kit.selectPlacements(options);
103103
} catch (error) {
104104
return Promise.reject(error instanceof Error ? error : new Error('Unknown error occurred'));

0 commit comments

Comments
 (0)