A simple set of custom error classes.
A small set of custom error classes for Node.js.
Just install with
npm install er or add it to your
Er... is really easy to use, it's just a set of error classes!
All of the classes are available by requiring the 'er' module,
and they all extend
Error so you can throw them :)
# CoffeeScriptrequire 'er'throw 'File secret-stuff.txt was not found'
er namespace has the following properties, each of which
is an error class:
Throw when an argument is set to an unexpected or incorrect value.
ArgumentMissingError extends ArgumentError
Throw when a required argument is
ArgumentRangeError extends ArgumentError
Throw when an argument value is out of the expected range.
ArgumentTypeError extends ArgumentError
Throw when an argument type is invalid.
Throw when a filesystem operation fails.
DirectoryNotFoundError extends IOError
Throw when a requested directory is not found.
FileNotFoundError extends IOError
Throw when a requested file is not found.
Throw when a constructor function is called without the
In order to develop Er..., you'll need to install the following npm modules globally like so:
npm install -g coffee-script npm install -g jake
And then install development dependencies locally with:
Once you have these dependencies, you will be able to run the following commands:
jake lint: Run CoffeeLint on the CoffeeScript source.
jake test: Run all unit tests.