Typescript assertion for Nodejs exceptions
npm i --save is-errno-exception
import { isErrnoException } from 'is-errno-exception';
try {
// ...
} catch (e) {
if (!isErrnoException(e) || e.code !== 'ABORT_ERR') {
throw e;
}
console.log('Aborted');
}