Skip to content

Commit

Permalink
Properly catch client errors
Browse files Browse the repository at this point in the history
  • Loading branch information
eschnou committed Feb 19, 2011
1 parent b2da1cb commit cc2c74a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/ostatus/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ function get(url, callback, headers) {
var client = Http.createClient(port, host, secure);
var request = client.request('GET', path, headers);
var body = "";


client.on('error', function(err) {
callback(err);
});

request.on('response', function (response) {
response.setEncoding('utf8');
response.on('data', function (chunk) {
Expand Down

0 comments on commit cc2c74a

Please sign in to comment.