error2

0.2.2 • Public • Published

More expressive error creation

For Node.js only ATM.

Usage:

  Error2 = require("error2");
 
  Error2();
  Error2(data);
  Error2(message);
  Error2(name, data);
  Error2(name, message);
  Error2(name, message, data);

where

  typeof name     === "string"
  typeof message  === "string"
  typeof data     === "object"

data object can contain name and message properties, which will therfore be used.

Please consult test cases for more funny and informative examples of use.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.2.2
    1
    • latest

Version History

Package Sidebar

Install

npm i error2

Weekly Downloads

1

Version

0.2.2

License

GPL 3

Last publish

Collaborators

  • lazurski