imbrianj / switchBoard

Control of Internet connected devices within a given network via web interface.
MIT License
201 stars 53 forks source link

Weather JSON Parsing Error "Unexpected End of Input" #19

Closed afewremarks closed 10 years ago

afewremarks commented 10 years ago

Not sure on this one. I think it maybe on the weather API side but it does cause the server to error out. Saw it happen twice on Wed (just finally restarted the server logging the api responses to console). Here is the error:

undefined:1 ther.yahoo.com/forecast/USCA0993_f.html","pubDate":"Wed, 23 Jul 2014 10:52 pm ^ SyntaxError: Unexpected end of input at Object.parse (native) at IncomingMessage. (/usr/local/lib/node_modules/switchBoard/controllers/weather.js:89:42) at IncomingMessage.g (events.js:180:16) at IncomingMessage.EventEmitter.emit (events.js:117:20) at _stream_readable.js:919:16 at process._tickCallback (node.js:419:13)

imbrianj commented 10 years ago

https://github.com/imbrianj/switchBoard/commit/8c2d428199d3ae09376e60033101964716a3d991