sensordb2 e64a8defe5 3.17 | 1 year ago | |
---|---|---|
.. | ||
node_modules | 1 year ago | |
LICENSE | 1 year ago | |
README.md | 1 year ago | |
index.js | 1 year ago | |
package.json | 1 year ago |
Error handling for vinyl plugins. Just an abstraction of what's in gulp-util with minor changes.
Install with npm
$ npm i plugin-error --save
var PluginError = require('plugin-error');
Params
pluginName
should be the module name of your pluginmessage
{String|Object}: may be a string or an existing error objectoptions
{Object}Behavior:
options.showStack
to true if you think the stack is important for your error.err.toString()
, but may be omitted by including {showProperties: false}
in the options.Examples
All of the following are acceptable forms of instantiation:
var err = new PluginError('test', {
message: 'something broke'
});
var err = new PluginError({
plugin: 'test',
message: 'something broke'
});
var err = new PluginError('test', 'something broke');
var err = new PluginError('test', 'something broke', {showStack: true});
var existingError = new Error('OMG');
var err = new PluginError('test', existingError, {showStack: true});
Install dev dependencies:
$ npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Jon Schlinkert
Copyright © 2015 Jon Schlinkert Released under the MIT license.
This file was generated by verb-cli on May 31, 2015.