Skip to content

Commit

Permalink
Merge pull request #73 from Raynos/expose-meta-2
Browse files Browse the repository at this point in the history
expose more meta information on HTTP errors
  • Loading branch information
mattrobenolt committed Mar 26, 2014
2 parents e2063b3 + 2c412ad commit 24e05de
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/transports.js
Expand Up @@ -28,6 +28,9 @@ HTTPTransport.prototype.send = function(client, message, headers, ident) {
e.response = res;
e.statusCode = res.statusCode;
e.reason = reason;
e.sendMessage = message;
e.requestHeaders = headers;
e.ident = ident;
client.emit('error', e);
}
// force the socket to drain
Expand All @@ -39,7 +42,7 @@ HTTPTransport.prototype.send = function(client, message, headers, ident) {
client.emit('error', e);
});
req.end(message);
}
};

var https = require('https');
function HTTPSTransport() {
Expand All @@ -64,7 +67,7 @@ UDPTransport.prototype.send = function(client, message, headers, ident) {
client.emit('logged', ident);
udp.close();
});
}
};

module.exports.http = new HTTPTransport();
module.exports.https = new HTTPSTransport();
Expand Down

0 comments on commit 24e05de

Please sign in to comment.