This package has been deprecated

Author message:

This module is no longer maintained. If you're interested in taking over maintenance of this repo, please contact the author

er

0.2.0 • Public • Published

Er...

A small set of custom error classes for Node.js.

Installation

Just install with npm install er or add it to your package.json.

Usage

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 :)

// JavaScript
var FileNotFoundError = require('er').FileNotFoundError;
throw new FileNotFoundError('File secret-stuff.txt was not found');
# CoffeeScript 
{FileNotFoundError} = require 'er'
throw new FileNotFoundError 'File secret-stuff.txt was not found'

The er namespace has the following properties, each of which is an error class:

ArgumentError
Throw when an argument is set to an unexpected or incorrect value.

ArgumentMissingError extends ArgumentError
Throw when a required argument is undefined or null.

ArgumentRangeError extends ArgumentError
Throw when an argument value is out of the expected range.

ArgumentTypeError extends ArgumentError
Throw when an argument type is invalid.

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

ConstructionError
Throw when a constructor function is called without the new keyword.

Development

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:

npm install

Once you have these dependencies, you will be able to run the following commands:

jake build: Build JavaScript from the CoffeeScript source.

jake lint: Run CoffeeLint on the CoffeeScript source.

jake test: Run all unit tests.

License

Dual licensed under the MIT or GPL Version 2 licenses.

Dependencies (0)

    Dev Dependencies (5)

    Package Sidebar

    Install

    npm i er

    Weekly Downloads

    37

    Version

    0.2.0

    License

    none

    Last publish

    Collaborators

    • rowanmanning