valueerror

0.0.2 • Public • Published

ValueError

npm version Build Status Coverage Status

ValueError, an instance of Error, for Node.js


Installation

npm install valueerror

Usage

Same as the Error constructor function. For example,

var ValueError = require('valueerror');
...
throw new ValueError('Input cannot have underscores');

The new is optional here. So the above code can be written as

throw ValueError('Input cannot have underscores');

Similarly, the ValueError can be used to check the instance like this

new ValueError() instanceof ValueError // true
new ValueError() instanceof Error      // true

Package Sidebar

Install

npm i valueerror

Weekly Downloads

3

Version

0.0.2

License

GPL-3.0

Last publish

Collaborators

  • thefourtheye