requestify icon indicating copy to clipboard operation
requestify copied to clipboard

Printing of rejection value on failed `get()`

Open anodynos opened this issue 11 years ago • 3 comments

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' }

anodynos avatar Jan 30 '14 15:01 anodynos

Thanks for the input, just out of curiosity, what would you expect to get in return in such case?

ranm8 avatar Feb 10 '14 11:02 ranm8

Just the rejection & the reason (i.e error), without printing

anodynos avatar Feb 11 '14 09:02 anodynos

me too having same issue... please let me know the solution for this.

ashabhatt avatar Sep 10 '14 05:09 ashabhatt