Closed LocutusOfBorg closed 6 years ago
it is not happening everytime, but so often in the last few days, probably the server is not answering correctly due to highload, and the example code crashes
this seems to be coming back undefined every attempt now anyone else ?
it really depends on the server I guess
maybe i was put on a shadow ban, but this seems to return undefined and never catches the encountered pokemon.
The Niantic servers aren't going to send you what you want when you expect it every time. Really, your code should be able to handle these error cases. So, in this case, instead of assuming you're going to get xdat.Status, you should first check whether you have it before using it. This is just good practice in general regardless of one's project.
example.js:116 console.log(status[xdat.Status]); ^ TypeError: Cannot read property 'Status' of undefined