Socket
Book a DemoInstallSign in
Socket

error2

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

error2

More expressive error constructor

npmnpm
Version
0.1.2
Version published
Weekly downloads
3
50%
Maintainers
1
Weekly downloads
 
Created
Source

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.

Keywords

Error

FAQs

Package last updated on 08 Mar 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts