Closed hefekranz closed 7 years ago
Node's http.get
callback doesn't take an error — anything that does is an error-first callback in node.
For http.get
:
var Promise = require('promise');
var http = require('http')
var promise = new Promise(function (resolve, reject) {
http.get('http://www.google.com', resolve).on('error', reject)
});
Cheers and thank you for your work.
Thanks ❤️
Not a biggie, but it can be frustrating for noobs.
In the Promise examples in the readme:
"err" and "res" have the wrong order, thus rejecting the correct response. If this is referring to nodes http.get at least.
Not sure though, I'm a noob myself :)
Cheers and thank you for your work.