Socket
Socket
Sign inDemoInstall

plugin-error

Package Overview
Dependencies
2
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    plugin-error

Error handling for Vinyl plugins.


Version published
Weekly downloads
2.2M
increased by0.68%
Maintainers
2
Install size
37.7 kB
Created
Weekly downloads
 

Changelog

Source

2.0.1 (2022-12-06)

Bug Fixes

  • Exclude domainEmitter from output (#26) (2a89513)

Readme

Source

plugin-error

NPM version Downloads Build Status Coveralls Status

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

Keywords

FAQs

Last updated on 06 Dec 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc