$ gnpm install plugin-error
Error handling for Vinyl plugins.
var PluginError = require('plugin-error');
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 });
new PluginError(pluginName, message[, options])
Error constructor that takes:
pluginName
- a String
that should be the module name of your pluginmessage
- a String
message or an existing Error
objectoptions
- an Object
of your optionsBehavior:
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.MIT
Copyright 2013 - present © cnpmjs.org | Home |