Proper error handling in JavaScript | Hacker News Reader