for jsdoc3/jsdoc3.github.com#5 - mention jsdoc/util/error in plugin docs

This commit is contained in:
mathematicalcoffee 2013-01-18 14:43:42 +10:00
parent 4a57a3718c
commit 7678689278

View File

@ -343,6 +343,17 @@ conf.json file. A plugin can stop later plugins from visiting a node by
setting a ```stopPropagation``` property on the event object (e.stopPropagation = true).
A plugin can stop the event from firing setting a ```preventDefault``` property.
### Throwing Errors
If you wish your plugin to throw an error, do it using the `handle` function in
the `jsdoc/util/error` module:
require('jsdoc/util/error').handle( new Error('I do not like green eggs and ham!') );
By default this will throw the error, halting the execution of `jsdoc`. However,
if the user used the `--lenient` switch when they ran `jsdoc` it will simply log
the error to the console and continue.
Packaging JSDoc 3 Plugins
----
@ -370,4 +381,4 @@ The task is passed a directory that should look something like the following:
\- publish.js
Basically everything is copied over into the jsdoc installation directory, the
directory should contain anything you want to put there.
directory should contain anything you want to put there.