# exitBlockOnFail block on fail in a during loop

**URL:** <https://community.gatling.io/t/exitblockonfail-block-on-fail-in-a-during-loop/504>\
**Category:** Gatling (Open-Source)\
**Created:** [July 25, 2013, 9:29am UTC](https://community.gatling.io/t/exitblockonfail-block-on-fail-in-a-during-loop/504 "2013-07-25T09:29:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Henri\_Tremblay](https://avatars.discourse-cdn.com/v4/letter/h/82dd89/32.png) [@Henri\_Tremblay](https://community.gatling.io/u/Henri_Tremblay)\
**Post date:** [July 25, 2013, 9:29am UTC](https://community.gatling.io/t/exitblockonfail-block-on-fail-in-a-during-loop/504/1 "2013-07-25T09:29:26Z")

</div>

Hi,

I’ trying to do the following:

exec(LOGIN)  
.during(120) {  
exitBlockOnFail ( // or should it be braces?  
exec(BUSINESS)  
)  
}  
.exec(LOGOUT)

My goal is to exit the BUSINESS block as soon as there is an error but I still want to continue until the during loop as expired.

Currently, the user seems to exit the during loop.

What am I doing wrong?

Thanks  
Henri

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [July 25, 2013, 9:35am UTC](https://community.gatling.io/t/exitblockonfail-block-on-fail-in-a-during-loop/504/2 "2013-07-25T09:35:10Z")

</div>

Looks like a bug, can you open an issue, please?

---

<div class="post-metadata">

**Author:** ![Henri\_Tremblay](https://avatars.discourse-cdn.com/v4/letter/h/82dd89/32.png) [@Henri\_Tremblay](https://community.gatling.io/u/Henri_Tremblay)\
**Post date:** [July 25, 2013, 4:38pm UTC](https://community.gatling.io/t/exitblockonfail-block-on-fail-in-a-during-loop/504/3 "2013-07-25T16:38:47Z")

</div>

Sure. I’ll cook a use-case.

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [July 25, 2013, 4:40pm UTC](https://community.gatling.io/t/exitblockonfail-block-on-fail-in-a-during-loop/504/4 "2013-07-25T16:40:23Z")

</div>

Would be great!
