mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
Add error handling to newsfeed
This commit is contained in:
parent
6febcf3b94
commit
a7619771a6
@ -85,7 +85,12 @@ var Fetcher = function(url, reloadInterval, encoding) {
|
|||||||
nodeVersion = Number(process.version.match(/^v(\d+\.\d+)/)[1]);
|
nodeVersion = Number(process.version.match(/^v(\d+\.\d+)/)[1]);
|
||||||
headers = {"User-Agent": "Mozilla/5.0 (Node.js "+ nodeVersion + ") MagicMirror/" + global.version + " (https://github.com/MichMich/MagicMirror/)"}
|
headers = {"User-Agent": "Mozilla/5.0 (Node.js "+ nodeVersion + ") MagicMirror/" + global.version + " (https://github.com/MichMich/MagicMirror/)"}
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user