Set a variable if css succeed without exception

Hi,
sorry for harassing, I have another small problem and can’t find a solution…
I make another list of links (like in my previous message : https://groups.google.com/forum/#!topic/gatling/1TpcP8ukJKw) but sometimes the css request may fail and throw an exception. How can I set the variable if the css request succeed ? Here is a part of my code :

exec(
http(“Question ${next_question}”).get("${next_question}").check(
css("""#block-system-main .region-two-66-33-first .block-content article""", “id”).saveAs(“question_id”),
css("""#block-system-main .pane-node-content h2""").saveAs(“question_title”),
css(""“form#comment-form”"", “action”).saveAs(“comment_action”),
css(""“form#comment-form input[name=“form_build_id”]”"", “value”).saveAs(“comment_build_id”),
css(""“form#comment-form input[name=“form_token”]”"", “value”).saveAs(“comment_token”),
css(""“form#answer-node-form input[name=“form_build_id”]”"", “value”).saveAs(“answer_build_id”),
css(""“form#answer-node-form input[name=“form_token”]”"", “value”).saveAs(“answer_token”),
css(""“form#answer-node-form”"", “action”).saveAs(“answer_action”),
css(""".bonita-views-answer-content-pane .view-content article.node.node-answer header h1 a""", “href”).findAll.saveAs(“answer_links”),
regex(""",“checksum”:"([a-z0-9]+)"}""").saveAs(“checksum”)))

The last css request may fail

Many thanks

css(""".bonita-… header h1 a""", “href”).findAll.whatever.saveAs(“answer_links”)

See https://github.com/excilys/gatling/wiki/Checks#wiki-whatever
OK ?

cheers
Nicolas

That’s it :slight_smile: