You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### new PluginError(pluginName, message[, options]);
18
-
19
-
**Params**
20
-
21
-
*`pluginName` should be the module name of your plugin
22
-
*`message`**{String|Object}**: may be a string or an existing error object
23
-
*`options`**{Object}**
24
-
25
-
**Behavior:**
26
-
27
-
* By default the stack will not be shown. Set `options.showStack` to true if you think the stack is important for your error.
28
-
* If you pass an error object as the message the stack will be pulled from that, otherwise one will be created.
29
-
* If you pass in a custom stack string you need to include the message along with that.
30
-
* Error properties will be included in `err.toString()`, but may be omitted by including `{showProperties: false}` in the options.
31
17
32
-
**Examples**
33
-
34
-
All of the following are acceptable forms of instantiation:
35
-
36
-
```javascript
37
18
var err =newPluginError('test', {
38
19
message:'something broke'
39
20
});
@@ -45,44 +26,44 @@ var err = new PluginError({
45
26
46
27
var err =newPluginError('test', 'something broke');
47
28
48
-
var err =newPluginError('test', 'something broke', {showStack:true});
29
+
var err =newPluginError('test', 'something broke', {showStack:true});
49
30
50
31
var existingError =newError('OMG');
51
-
var err =newPluginError('test', existingError, {showStack:true});
32
+
var err =newPluginError('test', existingError, {showStack:true});
52
33
```
53
34
54
-
## Related projects
55
-
56
-
*[assemble](http://assemble.io): Static site generator for Grunt.js, Yeoman and Node.js. Used by Zurb Foundation, Zurb Ink, H5BP/Effeckt,… [more](http://assemble.io)
57
-
*[gulp-util](https://github.com/wearefractal/gulp-util#readme): Utility functions for gulp plugins
58
-
*[gulp](http://gulpjs.com): The streaming build system
59
-
*[generate](https://github.com/generate/generate): Project generator, for node.js.
60
-
*[verb](https://github.com/assemble/verb): Documentation generator for GitHub projects. Extremely powerful, easy to use, can generate anything from API… [more](https://github.com/assemble/verb)
*`pluginName` - a `String` that should be the module name of your plugin
41
+
*`message` - a `String` message or an existing `Error` object
42
+
*`options` - an `Object` of your options
65
43
66
-
```sh
67
-
$ npm i -d && npm test
68
-
```
69
-
70
-
## Contributing
44
+
**Behavior:**
71
45
72
-
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/plugin-error/issues/new)
46
+
* By default the stack will not be shown. Set `options.showStack` to true if you think the stack is important for your error.
47
+
* If you pass an error object as the message the stack will be pulled from that, otherwise one will be created.
48
+
* If you pass in a custom stack string you need to include the message along with that.
49
+
* Error properties will be included in `err.toString()`, but may be omitted by including `{ showProperties: false }` in the options.
0 commit comments