title: Attempting to assert 500 error, but response is null when conditions are met
body: <p>When I automated this I came to know that the 500 error that is thrown is given by server. But at our code level we have handled the exception and the response =null </p>
  
  <p>So when I tried to assert with response.status==500 it fails as the response is altogether null.</p>
  
  <pre><code>package test
  
  import geb.spock.GebReportingSpec
  import groovyx.net.http.RESTClient
  import net.sf.json.JSON
  
  import org.apache.log4j.Logger
  import spock.lang.Specification
  import spock.lang.Unroll
  
  class EventsAPITest extends GebReportingSpec{
  
      static Logger logger = Logger.getLogger("EventsAPITest");
  
      @Unroll
      def "Call calendar event for Invalid Location id 110 throws groovyx.net.http.HttpResponseException"() {
          given:
          RESTClient restClient = new RESTClient("https://test-api2.club-os.com")
          def response=restClient.get(path: '/authenticate',requestContentType: JSON,query:[
              'username': 'apiuser',
              'password':'apipassword',
          ])
          def authToken=response.data.token
          logger.info"Token:" +authToken
          restClient.defaultRequestHeaders['Authorization'] = authToken
          def locationId=110
          when:
          response=restClient.get(path: '/locations/'+locationId+'/events',requestContentType: JSON, query:[
              'startTimeStartAt': '2018-05-25T17:00:00.000Z',
              'startTimeEndAt':'2018-06-01T17:00:00.000Z',
              'eventTypeId' : 2                      ])
          then:
          thrown groovyx.net.http.HttpResponseException
          logger.info"Response: "+ response
          //  assert response.data.errorMessage=="Error"
          assert  response.status == 500
          //assert    response.status == 500
          //  assert  response.data.errorMessage == "An unknown error occurred"
      }
  </code></pre>
  
  <p>I would like to be able to assert a 500 error and have that returned.</p>