summaryrefslogtreecommitdiffstats
path: root/lib/backbone
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-02-11 10:07:15 +0100
committerSamy Pessé <samypesse@gmail.com>2016-02-11 10:07:15 +0100
commit52c4dc49cf460dad4edc42457ba9e3ca4c7674d5 (patch)
tree6d5d123756c8d79ab5add4660e7b66beb3e89736 /lib/backbone
parent44ad70320a0d0b907702c57e560c6a60373c9bca (diff)
downloadgitbook-52c4dc49cf460dad4edc42457ba9e3ca4c7674d5.zip
gitbook-52c4dc49cf460dad4edc42457ba9e3ca4c7674d5.tar.gz
gitbook-52c4dc49cf460dad4edc42457ba9e3ca4c7674d5.tar.bz2
Normalize errors
Diffstat (limited to 'lib/backbone')
-rw-r--r--lib/backbone/summary.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/backbone/summary.js b/lib/backbone/summary.js
index 009fb76..35f65e6 100644
--- a/lib/backbone/summary.js
+++ b/lib/backbone/summary.js
@@ -3,6 +3,7 @@ var util = require('util');
var url = require('url');
var location = require('../utils/location');
+var error = require('../utils/error');
var BackboneFile = require('./file');
@@ -15,10 +16,10 @@ function TOCArticle(summary, title, ref, articles, parent) {
this.title = title;
if (ref && location.isExternal(ref)) {
- throw new Error('SUMMARY can only contains relative locations');
+ throw error.ParsingError(new Error('SUMMARY can only contains relative locations'));
}
if (!title) {
- throw new Error('SUMMARY entries should have an non-empty title');
+ throw error.ParsingError(new Error('SUMMARY entries should have an non-empty title'));
}
var parts = url.parse(ref);