Skip to content

getaddrinfo ENOTFOUND #8

@treemore

Description

@treemore

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions