Initial changes to error messages

This commit is contained in:
Frank Li 2017-08-09 15:43:30 -07:00
parent e285f93c1b
commit b256d2f8d9
7 changed files with 45 additions and 6 deletions

View file

@ -128,6 +128,12 @@ class HeaderNav extends React.Component {
"-" +
link.doc;
}
if (!Metadata[id]) {
throw new Error(
"A headerLink is specified with a document that does not exist. No document exists with id: " +
link.doc
);
}
href = this.props.config.baseUrl + Metadata[id].permalink;
} else if (link.page) {
if (fs.existsSync(CWD + "/pages/en/" + link.page + ".js")) {