# check failed but still continue executing the rest of the command

**URL:** <https://community.gatling.io/t/check-failed-but-still-continue-executing-the-rest-of-the-command/557>\
**Category:** Gatling (Open-Source)\
**Created:** [August 29, 2013, 5:15pm UTC](https://community.gatling.io/t/check-failed-but-still-continue-executing-the-rest-of-the-command/557 "2013-08-29T17:15:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shawna](https://avatars.discourse-cdn.com/v4/letter/s/b9e5f3/32.png) [@Shawna](https://community.gatling.io/u/Shawna)\
**Post date:** [August 29, 2013, 5:15pm UTC](https://community.gatling.io/t/check-failed-but-still-continue-executing-the-rest-of-the-command/557/1 "2013-08-29T17:15:15Z")

</div>

I am using gatling 1.5.2  
exec(http(“register?instance\_id=?\_${jca}”)  
.get("${url}")  
.check(status.is(200))  
.check(bodyString.saveAs(“getBodyString”)))  
.exec(session =\>{  
val getBodyString = session.getTypedAttributeString  
…

})  
.exec(getWebsocketToken)

HTTP request:  
GET [https://realtime-disc.test.jivehosted.com/register?instance\_id=daddd677-4341-48ff-9b77-346e39023e40&activation\_code=67169661](https://realtime-disc.test.jivehosted.com/register?instance_id=daddd677-4341-48ff-9b77-346e39023e40&activation_code=67169661)

---

<div class="post-metadata">

**Author:** ![Ludovic\_Mercier](https://avatars.discourse-cdn.com/v4/letter/l/9d8465/32.png) [@Ludovic\_Mercier](https://community.gatling.io/u/Ludovic_Mercier)\
**Post date:** [August 30, 2013, 7:29am UTC](https://community.gatling.io/t/check-failed-but-still-continue-executing-the-rest-of-the-command/557/2 "2013-08-30T07:29:20Z")

</div>

Hi,

You can try the syntax below to solve you problem :  
**exitBlockOnFail {**

exec(http(“register?instance\_id=?\_${jca}”)  
.get("${url}")  
.check([status.is](http://status.is/)(200))  
.check(bodyString.saveAs(“getBodyString”)))  
.exec(session =\>{  
val getBodyString = session.getTypedAttributeString  
…

})  
.exec(getWebsocketToken)

**}**

If the check on the status failed, the second exec and other in the block won’t be process.

Hope this help

Ludovic

---

<div class="post-metadata">

**Author:** ![Shawna](https://avatars.discourse-cdn.com/v4/letter/s/b9e5f3/32.png) [@Shawna](https://community.gatling.io/u/Shawna)\
**Post date:** [September 26, 2013, 9:53pm UTC](https://community.gatling.io/t/check-failed-but-still-continue-executing-the-rest-of-the-command/557/3 "2013-09-26T21:53:27Z")

</div>

That works! Thx!
