requestify
requestify copied to clipboard
Printing of rejection value on failed `get()`
Hi,
I am using v0.1.16 and when executing the simplest require('requestify').get('https://localhost') (where https is NOT configured on my box) I get an unwanted printout of:
{ [Error: connect ECONNREFUSED]
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect' }
It turns out it is the rejection error being printed :
require('requestify').get('https://localhost').then(function(resp) {
return console.log(resp);
}, function(rej) {
return console.log("rej = ", rej);
});
gives
{ [Error: connect ECONNREFUSED]
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect' }
rej = { [Error: connect ECONNREFUSED]
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect' }
Thanks for the input, just out of curiosity, what would you expect to get in return in such case?
Just the rejection & the reason (i.e error), without printing
me too having same issue... please let me know the solution for this.