0.1.0 • Published 10 years ago

error-foundry-js v0.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

error-foundry-js

A minimalistic Javascript Universal Module to create custom errors.

Installation

npm install error-foundry-js --save

or

bower install error-foundry-js --save

Usage

Node

var
	ErrorFoundry = require('error-foundry-js');

var
	CustomError = ErrorFoundry.forge('CustomError');

throw new CustomError();

Browser

Globals

<script src="js/vendor/ErrorFoundry.min.js">
<script>
	var
		CustomError = ErrorFoundry.forge('CustomError');

	throw new CustomError();
</script>

AMD

define([ 'ErrorFoundry' ], function (ErrorFoundry) {
	var
		CustomError = ErrorFoundry.forge('CustomError');

	return CustomError;
});