claudiowilson/LeagueJS

Seems to be an issue with getPlayerSummary()

Closed this issue · 2 comments

events.js:72
throw er; // Unhandled 'error' event
^
Error: getaddrinfo ENOTFOUND
at errnoException (dns.js:37:11)
at Object.onanswer as oncomplete

is being returned from:

LolApi.init(leagueKey);
LolApi.Stats.getPlayerSummary(sumId, 2015, region, function(error, out) {
...
}

Which I found quite interesting. Dug through the api, I couldn't find the cause – However, I don't think it's an issue with my coding, as even an empty api call here returns that error. (sumId, region are defined above as parameters.) I saw that in util.js getValidSeasonParam used ===, so I tried both 2015 as an integer and a string – neither worked. I even tried it as an array, as the README suggested.

I use the client with promises and not callbacks, so ymmv, but I just checked some of my code that uses this library and this is what I have.

// grab the library
var LolApi = require('leagueapi');
// initialize with my key and for region 'na'
LolApi.init(process.env.LOL_API_KEY, 'na');
// make a request and process the result
LolApi.Summoner.getByName(summoner_name, region).then(function (data) {
  var id = data && data[summoner_name].id;
});

Could you tell us more about the value in sumId and region?

i think this issue can be closed