if-err

0.3.0 • Public • Published

ifErr

get rid of if (err) throw err

install

npm install if-err

usage

var error = require('if-err');
 
asyncFunc(function (err) {
  error.if(err);
});
 
asyncFunc(function (err) {
  error.if(err, 'bad things happened');
});
 
asyncFunc(function (err, data) {
  error.if(err, 'bad things happened');
  error.ifNot(data, 'data wasn\'t returned');
});

Contributors

Readme

Keywords

Package Sidebar

Install

npm i if-err

Weekly Downloads

1,436

Version

0.3.0

License

ISC

Last publish

Collaborators

  • rhettl