Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

error2

0.1.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.

Install

npm i [email protected]

Version

0.1.2

License

GPL 3

Last publish

Collaborators

  • avatar