const client = http2.
connect('https://domain.doesnt.exist').
on('error', e => {
console.error(e.message);
});
On Node.js 13.6.0, even when provided an error listener, the above code would crash the entire process.
How will I be able to avoid it?
you can use uncaughtException
event to log all exceptions not been caught..
process.on('uncaughtException', err => {
console.log(err.message);
console.log(err.stack);
process.exit(1)
})
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.