diff --git a/newsyc.js b/newsyc.js index 5b68073..d30933c 100644 --- a/newsyc.js +++ b/newsyc.js @@ -36,7 +36,11 @@ list.on('keypress', function(key, item){ console.log("Fetching news..."); require("hn.js").home(function(err, items) { - if(err) return console.error(err); + if(err || !items.length) { + console.error(err || "HN is probably down :-("); + process.exit(1); + return; + } items.forEach(function(o){ news[o.id] = o; diff --git a/package.json b/package.json index 81f9b9b..20627c2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "term-hackernews", - "version": "0.1.0", + "version": "0.2.0", "description": "Command line reader for Hacker News", "main": "newsyc.js", "bin": {