error-foundry-js
v0.1.0
Published
A minimalistic Javascript Universal Module to create custom errors
Downloads
5
Readme
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;
});