add error handlers to requests and sockets

Trying to flush out cause of sporadic socket failures and identify which
socket is not being handled.
This commit is contained in:
Roman Shtylman
2016-11-27 09:49:10 -08:00
parent 5ee2ded1fd
commit 2a6561e774
2 changed files with 19 additions and 10 deletions

View File

@@ -28,16 +28,8 @@ test('landing page', function(done) {
var req = http.request(opt, function(res) {
res.setEncoding('utf8');
var body = '';
res.on('data', function(chunk) {
body += chunk;
});
res.on('end', function() {
assert(body.indexOf('Redirecting to https://localtunnel.github.io/www/') > 0);
done();
});
assert.equal(res.headers.location, 'https://localtunnel.github.io/www/')
done();
});
req.end();