Skip to content

Commit f830c3c

Browse files
update: Handle errors in decision result to prevent fallback to next experiment
1 parent 2fc8372 commit f830c3c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/optimizely/decision_service.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,10 @@ def get_variation_for_feature_experiment(project_config, feature_flag, user_cont
238238
variation_id = variation_result.variation_id
239239
cmab_uuid = variation_result.cmab_uuid
240240
decide_reasons.push(*reasons_received)
241+
242+
# If there's an error, return immediately instead of falling back to next experiment
243+
return DecisionResult.new(nil, error, decide_reasons) if error
244+
241245
next unless variation_id
242246

243247
variation = project_config.get_variation_from_id_by_experiment_id(experiment_id, variation_id)

0 commit comments

Comments
 (0)