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.
request/request#1318
i think may
https://github.com/zenflow/node-fast-download/blob/master/lib/FastDownload.js#L37
will be on the 'error' event.
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
and if you use
can catch the exception.
request/request#1318
i think may
https://github.com/zenflow/node-fast-download/blob/master/lib/FastDownload.js#L37
will be on the 'error' event.