Async action and failure reporting

Hello,

I am looking to the https://github.com/jagregory/gatling/blob/master/gatling-protodemo/src/main/scala/com/thoughtworks/gatling/action/PingAction.scala example to understand how to implement a custom protocol in Gatling.

In case my operation is asynchronous, what’s the correct way of reporting errors?

Should I do something

myAction onComplete {
success => DataWriter.logRequest(“success”)
next ! session
failure => DataWriter.logRequest(“Failure”)
next ! session

}

Regards

Edmondo

https://github.com/gatling/gatling/blob/v2.1.4/gatling-core/src/main/scala/io/gatling/core/result/writer/DataWriter.scala#L123

Beware, this will change quite a lot in 2.2.