Skip to content

Commit

Permalink
Merge pull request #579 from brosy/handle-newsfeed-errors
Browse files Browse the repository at this point in the history
Add error handling to newsfeed
  • Loading branch information
MichMich authored Dec 31, 2016
2 parents b8167f8 + cebed08 commit 65b8f78
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions js/class.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@

return ret;
};
})(name, prop[name]) :
prop[name];
})(name, prop[name]) :
prop[name];
}

// The dummy class constructor
Expand Down
7 changes: 6 additions & 1 deletion modules/default/newsfeed/fetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,12 @@ var Fetcher = function(url, reloadInterval, encoding) {
});

var headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A'};
request({uri: url, encoding: null, headers: headers}).pipe(iconv.decodeStream(encoding)).pipe(parser);
request({uri: url, encoding: null, headers: headers})
.on('error', function(error) {
fetchFailedCallback(self, error);
scheduleTimer();
})
.pipe(iconv.decodeStream(encoding)).pipe(parser);

};

Expand Down

0 comments on commit 65b8f78

Please sign in to comment.