fp-error-handling
Functional Error Handling
A fail-fast module for idiomatic splitting error handling from successful continuation.
Installation
The easiest way is to keep fp-error-handling
as a devDependency in your package.json
.
You can simple do it by:
npm install fp-error-handling --save-dev
Example
var MongoClient = MongoClient url = 'mongodb://localhost:27017/myproject'; MongoClient;
... becomes ...
var MongoClient = MongoClient url = 'mongodb://localhost:27017/myproject' failFast = ; MongoClient;
Usage
fp-error-handling
is a function that takes the following arguments:
- callback - (optional) the callback function that
fp-error-handling
will split error handling for, - continuation - (optional) a function where successful continuation proceeds,
- thisArg - (optional) an object that will be used as the continuation's this context.
Release History
(Nothing yet)
License
Licensed under the MIT license.