title: How to intercept rest-assured response validation failure
body: <p>In rest-assured, when we do</p>
  
  <pre><code>given().get("/api").then().statusCode(SC_OK).content(JSON);
  </code></pre>
  
  <p>The error thrown is always sequential, i.e. if the status code fails, it won't check if the contentType is JSON.</p>
  
  <p>Also, the error thrown is always, AssertionError (Expected : 200, Actual : 404)
  There is no way to understand from this, what was the actual response, it will be printed on the STDOUT if we enable logging, but it's not available any other way.</p>
  
  <p>Is there any way to build or setup something like how we can implement <code>Filter</code> which we can provide at request building to intercept the setting before the actual call</p>
  
  <p>I have a rest api framework where most of the validations are done using <code>ValidatableResponse</code>
  i.e. using <code>.then()...;</code> and not by creating expectations of the response at request building time.</p>
  
  <p>I wish to intercept a specific type of failures, i.e. if the status code failing is 50_ when we expected 200 or anything else, so that the actual failure can be posted in the test failure reason</p>
  
  <p>I did raise
  <a href="https://github.com/rest-assured/rest-assured/issues/1263" rel="nofollow noreferrer">github issue</a></p>
  
  <p>But I'm not sure if that will be implemented anytime soon. I'm not able to find anything in the documentations as well.</p>