 
       req.on 'error', (error) =>
         @serverError = true
-        if error.code == 'ECONNREFUSED'
+        if CONNECTION_ERRORS.indexOf(error.code) > -1
           logger.error "Apiary reporter: Error connecting to Apiary test reporting API."
           callback()
         else

      data = @_transformTestToReporter test
      data.result = 'error'

      connectionErrors = ['ECONNRESET', 'ENOTFOUND', 'ESOCKETTIMEDOUT', 'ETIMEDOUT', 'ECONNREFUSED', 'EHOSTUNREACH', 'EPIPE']
      if connectionErrors.indexOf(error.code) > -1
        data.resultData.errors.push "Error connecting to server under test!"
      else
        data.resultData.errors.push "Unhandled error occured when executing the transaciton."

      path = '/apis/' + @configuration['apiSuite'] + '/tests/steps?testRunId=' + @remoteId
      @_performRequest path, 'POST', data, (error, response, parsedBody) ->

        realResponse: test['actual']
        expectedResponse: test['expected']
        result: test['results']
        warnings: []
        errors: []

    return data
