Skip to content

Latest commit

 

History

History
23 lines (18 loc) · 329 Bytes

README.md

File metadata and controls

23 lines (18 loc) · 329 Bytes

is-errno-exception

Typescript assertion for Nodejs exceptions

Instalaton

npm i --save is-errno-exception

Usage

import { isErrnoException } from 'is-errno-exception';

try {
  // ...
} catch (e) {
  if (!isErrnoException(e) || e.code !== 'ABORT_ERR') {
    throw e;
  }
  console.log('Aborted');
}