ValueError
ValueError, an instance of Error, for Node.js
Installation
npm install valueerror
Usage
Same as the Error
constructor function. For example,
var ValueError = ;...throw 'Input cannot have underscores';
The new
is optional here. So the above code can be written as
throw ;
Similarly, the ValueError
can be used to check the instance like this
instanceof ValueError // true instanceof Error // true