From 7f7946a4c6f72b4e409222ad99adbf04f5c665b0 Mon Sep 17 00:00:00 2001 From: w-vi Date: Fri, 27 Nov 2015 13:57:49 +0100 Subject: [PATCH] different reqs? --- src/reporters/apiary-reporter.coffee | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/reporters/apiary-reporter.coffee b/src/reporters/apiary-reporter.coffee index 38fdc27d3..1fb7c030e 100644 --- a/src/reporters/apiary-reporter.coffee +++ b/src/reporters/apiary-reporter.coffee @@ -266,16 +266,15 @@ class ApiaryReporter if @configuration.apiUrl?.indexOf('https') is 0 console.log 'https' - req = https.request options, handleResponse + reqs = https.request options, handleResponse + reqs.on 'error', handleReqError + reqs.write postData + reqs.end() else console.log 'http' req = http.request options, handleResponse - - try req.on 'error', handleReqError req.write postData req.end() - catch e - handleReqError e module.exports = ApiaryReporter