Gatling2: Exception text during the test

Hello!

In my test i have users with different accounts, each type of account has id.

During the test I check this id to understand if current user can operate with this type of account.

Now I want create a scenario, where all users will randomly do all operation.

My request looks:

val request_payment = foreach("${acc_ids}", “acc_id”){

doIf(session => session(“acc_id”) == “10”) {

exec(http(“Local Payment”)

.get("/example.com/payments/local_payment.xml")

.headers(headers_Content_Length_0)

.queryParam(""“accid”"", “”“10"”")

)

I would like to make the check to throw the exception with more readable message like “user isn’t authorized for this kind of operation”.

Is it possible in Gatling2?

Thank You in advance

No, sorry, one can’t “override” a check message.

The thing is that there might be other bad things happening during check than the mere expected vs actual comparison, such as evaluating the expected from session data (this data could be missing, who knows). So a check could end up producing different messages, there’s not one signe possibility.