summaryrefslogtreecommitdiffstats
path: root/lib/utils/error.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-02-17 15:53:37 +0100
committerSamy Pessé <samypesse@gmail.com>2016-02-17 15:53:37 +0100
commitb2af55ac63886cba2075043554ff78c787cbb9e1 (patch)
tree18272b8172e12b38e6b84d890775913e541627d1 /lib/utils/error.js
parent40cdc285b613949347f2909d8f7027fc51b0db7f (diff)
downloadgitbook-b2af55ac63886cba2075043554ff78c787cbb9e1.zip
gitbook-b2af55ac63886cba2075043554ff78c787cbb9e1.tar.gz
gitbook-b2af55ac63886cba2075043554ff78c787cbb9e1.tar.bz2
Wrap error when loading plugin
Diffstat (limited to 'lib/utils/error.js')
-rw-r--r--lib/utils/error.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/utils/error.js b/lib/utils/error.js
index c1abebd..53d8221 100644
--- a/lib/utils/error.js
+++ b/lib/utils/error.js
@@ -48,6 +48,13 @@ var TemplateError = WrappedError({
filename: null
});
+// Error for nunjucks templates
+var PluginError = WrappedError({
+ message: 'Error with plugin "{plugin}": {origMessage}',
+ type: 'plugin',
+ plugin: null
+});
+
// Deprecate methods/fields
function deprecateMethod(fn, msg) {
return deprecated.method(msg, log.warn.ln, fn);
@@ -66,6 +73,7 @@ module.exports = {
FileOutOfScopeError: FileOutOfScopeError,
TemplateError: TemplateError,
+ PluginError: PluginError,
deprecateMethod: deprecateMethod,
deprecateField: deprecateField