0.0.9 • Published 10 years ago
exception-methods v0.0.9
exception-methods
Set of exception messages for JavaScript.
Installation
To install the stable version:
npm install --save exception-methodsThe Gist
import * as exceptionMethods from 'exception-methods';
console.log(exceptionMethods.argumentException('age', 'ageValue'));
console.log(exceptionMethods.invalidOperationException());
console.log(exceptionMethods.notImplementedException());
console.log(exceptionMethods.rangeException('age', -10));
console.log(exceptionMethods.typeException());
console.log(exceptionMethods.URIException());
console.log(exceptionMethods.customException('Custom Exception'));API
| Method | Description |
|---|---|
| argumentException | An exception that is useful for throwing or reporting exceptions related to function arguments |
| invalidOperationException | An exception that is useful for throwing or reporting exceptions related to invalid operations |
| notImplementedException | An exception that is useful for throwing or reporting exceptions related to unimplemented code |
| rangeException | An exception that is useful for throwing or reporting exceptions related to range errors |
| typeException | An exception that is useful for throwing or reporting exceptions related to type errors |
| URIException | An exception that is useful for throwing or reporting exceptions related to URI errors |
Examples
- Main (source)
License
MIT