Closed ilongin closed 10 years ago
You're right, I checked it right now. It makes a simple 'Unauthorized' log entry, and supposed to return res.statusCode, yet it returns null.
Addressing you second suggestion, yes, it would be probably a good idea to implement something like a verbose flag.
Do you want me to fix this issues or you want to do that ?
You can do it if you want to, go ahead. Thanks!
I will do it in a few days.
Hi,
looks like code really returns res.statusCode. Problem was that I had installed older version of this module (european npm registry is not so up to date as I can see). But I have removed console.logs and replaced them with debug module and it is all in pull request.
Ivan
I've put wrong apiKey and I've expected some error message like unauthorized and all I got in callback is null on both err and result. I think this is bad because client should know what caused an error (is it wrong apiKey or maybe GCM is unavailable or wrong payload is sent). I could make pull request by myself to fix this but first I am asking you what do you think about this.
Also I've seen much console.logs in code which is also bad because people usually don't want to have console.logs in production code, specially from some dependency libraries. You could use some debug library that client can turn on with environment variable like in this module : https://github.com/petkaantonov/bluebird
Ivan