Open vnoder opened 6 years ago
It seems that p-event just only resolved first error throwed out by got stream
.
I'm having the same problem. Even wrapped in try/catch this is terminating the program as an unhandled error.
Same here!
You can do this ugly workarround
Promise.resolve()
.then( () => {
return (async () => {
try {
return await download('https://www.ahostnotexisttddddd.com.hk', {
timeout: 100
})
} catch (err) {
throw err
}
})()
)
.then(result => {
console.log(result)
}).catch((err) => {
console.error('error catched!')
console.log(err)
})
eddited for better manage inside of a promisechain
It is very ugly but does the job. I think that the GOT package errors are not handled properly
same question here
my test code, just simple visit a host which not exist.
out put is