Commit 0c9d9511 authored by Grigorii Demidov's avatar Grigorii Demidov

additional error check

parent 0df2e24a
......@@ -437,9 +437,14 @@ class Scenario:
if (step.pause_if_fail > 0):
time.sleep(step.pause_if_fail)
if (step.next_if_fail != -1):
next_step = [j for j in range(len(self.steps)) if self.steps[j].id == step.next_if_fail][0]
next_steps = [j for j in range(len(self.steps)) if self.steps[j].id == step.next_if_fail]
if (len(next_steps) == 0):
raise Exception('step #%d: wrong NEXT value "%d"' % (step.id, step.next_if_fail))
next_step = next_steps[0]
if (next_step < len(self.steps)):
i = next_step
else:
raise Exception('step #%d: Can''t branch to NEXT value "%d"' % (step.id, step.next_if_fail))
continue
else:
raise Exception('step #%d %s' % (step.id, str(e)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment