handle request errors

handle request error.  Such as 'connect ECONNREFUSED' or 'getaddrinfo ENOTFOUND'.