Skip to content

luckydrq/cool-error

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cool-error

A shim module for wrapping error in a more elegant way!

###Install

  npm install cool-error

###Usage

####code

  var toss = require('cool-error')

  // equals `throw new Error('error!')`
  toss('error!')

  // when the second arg specified to true
  // it will log the error message before throwing an error instance
  toss('error!', true)

  // json format supported
  toss({statusCode: 404, msg: 'Not Found'})

####colors Feel free to use console.log('xxx'.red) in your code because colors is wrapped underlying.

About

A shim module for wrapping error in a more elegant way

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors