node package manager
Stop writing boring code. Discover, share, and reuse within your team. Create a free org »

lib-checked-domain

checked domain

Handle typed domain exceptions

install

npm install --save lib-checked-domain

usage

Catch known types, or throw when the type is unknown.

check(function () {
  // throw a *typed* exception 
  throw check.Error('exit', 'bad exit')
})
.on('fail', function () {
  // handle 'fail' type 
})
.on('exit', function () {
  // handle 'exit' type 
})

see also