diff --git a/js/app.js b/js/app.js index 8257bcd0..012d33ad 100644 --- a/js/app.js +++ b/js/app.js @@ -10,6 +10,15 @@ var Server = require(__dirname + "/server.js"); var defaultModules = require(__dirname + "/../modules/default/defaultmodules.js"); var path = require("path"); +// The next part is here to prevent a major exception when there +// is no internet connection. This could probable be solved better. +process.on('uncaughtException', function (err) { + console.log("Whoops! There was an uncaught exception..."); + console.error(err); + console.log("MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?"); + console.log("If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues"); +}); + /* App - The core app. */ var App = function() { diff --git a/modules/default/newsfeed/fetcher.js b/modules/default/newsfeed/fetcher.js index c406aed7..32081457 100644 --- a/modules/default/newsfeed/fetcher.js +++ b/modules/default/newsfeed/fetcher.js @@ -9,17 +9,6 @@ var FeedMe = require("feedme"); var request = require("request"); var iconv = require("iconv-lite"); - -// The next part is here to prevent a major exception when there -// is no internet connection. This could probable be solved better. -// If this is not here, the request on line 75 crashes when there -// is no internet connection available. -process.on('uncaughtException', function (err) { - console.log("There was an uncaught exception..."); - console.error(err); - console.log("MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?"); -}); - /* Fetcher * Responsible for requesting an update on the set interval and broadcasting the data. *