plugin-error
    Overview
    Documentation
    Insights
    Code
    Contributors
    Dependencies
    Alternatives

plugin-error

Error handling for Vinyl plugins.

1.0.1  •  Updated 1 years ago  •  by gulpjs  •  MIT License

plugin-error

NPM version Downloads Build Status AppVeyor Build Status Coveralls Status Gitter chat

Error handling for Vinyl plugins.

Usage

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 });

API

new PluginError(pluginName, message[, options])

Error constructor that takes:

  • pluginName - a String that should be the module name of your plugin
  • message - a String message or an existing Error object
  • options - an Object of your options

Behavior:

  • By default the stack will not be shown. Set options.showStack to true if you think the stack is important for your error.
  • If you pass an error object as the message the stack will be pulled from that, otherwise one will be created.
  • If you pass in a custom stack string you need to include the message along with that.
  • Error properties will be included in err.toString(), but may be omitted by including { showProperties: false } in the options.

License

MIT

How often do you use dark themes on other websites?

Popularity

Weekly Downloads
1.9M
Stars
15

Maintenance

Development

Last ver 2 years ago
Created 5 years ago
Last commit 2 years ago
4 days between commits

Technology

Node version: 8.9.4
0 unpacked

Compliance

MIT License
OSI Approved
0 vulnerabilities

Contributors

5 contributors
jonschlinkert
Maintainer, 7 commits, 1 merges
Works at sellside
Blaine Bublitz
Maintainer, 5 commits, 1 merges
Works at Paying the maintainers Tidelift
Charles Samborski
Maintainer, 2 commits, 1 merges, 2 PRs
shinnn
Maintainer, 1 merges
Steve Lacy
Maintainer, 1 commits, 1 PRs
Nils Knappmeier
1 commits, 1 PRs
Works at cosee

Tags

error
plugin
gulp-util
Ready for the next level?
Join Openbase's founding team to help us build the ultimate open-source app store, work with the latest technologies, and enjoy great culture, impact and autonomy
Openbase helps developers choose among and use millions of open-source packages, so they can build amazing products faster.
© 2020 Devstore, Inc.