getaddrinfo ENOTFOUND
when a url can not find the right dns,it will throw a Unhandled 'error' event. like the code blow.
https://npm.runkit.com/request
var request = require('request');
try{
var rr=request.head("http://www.aldlfladl22939334345.com",function(err,response,body){
console.info(err,body)
})
//rr.on('error',(error)=>{
//console.error('errorring',error);
//})
}catch(e){
console.error('eeeeing',e.message);
}
and if you use
rr.on('error',(error)=>{
console.error('errorring',error);
})
can catch the exception.
https://github.com/request/request/issues/1318
i think may
https://github.com/zenflow/node-fast-download/blob/master/lib/FastDownload.js#L37
will be on the 'error' event.
@treemore What is the issue? What would you expect to fast-download to do when a domain can't be resolved? And what does it actually do?
hi @zenflow
expect to fast-download to do when a domain can't be resolved :
emit the error event .
because domain can't be resolved use request lib we cannot know there is
a exception. event use try catch cannot capture this type exception.
may be like this
https://github.com/treemore/node-fast-download/blob/master/lib/FastDownload.js#L66