CICCIOSGAMINO / openweather-apis

Simple APIs for OpenWeatherMap.org basic services
GNU General Public License v3.0
44 stars 27 forks source link

Error on integer change weather.getWeatherForecastForDays(4, function(err, obj){ #17

Closed NMathar closed 7 years ago

NMathar commented 7 years ago

When ich change the integer for day to 4 I get an error like this.

Code:

weather.getWeatherForecastForDays(4, function(err, obj){
    console.log(err);
    console.log(obj);
});

Error:

{ error: 
   SyntaxError: Unexpected number in JSON at position 1
       at Object.parse (native)
       at IncomingMessage.<anonymous> (###APPPATH###/node_modules/openweather-apis/index.js:185:27)
       at emitOne (events.js:96:13)
       at IncomingMessage.emit (events.js:188:7)
       at readableAddChunk (_stream_readable.js:172:18)
       at IncomingMessage.Readable.push (_stream_readable.js:130:10)
       at HTTPParser.parserOnBody (_http_common.js:129:22)
       at Socket.socketOnData (_http_client.js:361:20)
       at emitOne (events.js:96:13)
       at Socket.emit (events.js:188:7) }
CICCIOSGAMINO commented 7 years ago

You can have a Forecast on free version ....

NMathar commented 7 years ago

The forecast is working but the most requests returns an error but sometimes it get datas from api. strange but ok for my project