Class: Gitlab::Experiment::NestingError
- Defined in:
- lib/gitlab/experiment/errors.rb
Instance Method Summary collapse
-
#initialize(experiment:, nested_experiment:) ⇒ NestingError
constructor
A new instance of NestingError.
Constructor Details
#initialize(experiment:, nested_experiment:) ⇒ NestingError
Returns a new instance of NestingError.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/gitlab/experiment/errors.rb', line 12 def initialize(experiment:, nested_experiment:) = [] experiments = [nested_experiment, experiment] callers = caller_locations callers.select.with_index do |caller, index| next if caller.label != 'experiment' << " #{experiments[.length].name} initiated by #{callers[index + 1]}" end << ["unable to nest #{nested_experiment.name} within #{experiment.name}:"] super(.reverse.join("\n")) end |