Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Commit

Permalink
feat(highlight): throw error if missing config in Algolia
Browse files Browse the repository at this point in the history
Closes: #273
  • Loading branch information
rayrutjes committed Aug 16, 2017
1 parent 1ff3601 commit 09d8d3d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/Highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ export default {
let attributeValue = '';
if (result._highlightResult && result._highlightResult[attributeName]) {
attributeValue = result._highlightResult[attributeName].value;
} else if (process.env.NODE_ENV !== 'production') {
throw new Error(
`The "${attributeName}" attribute is currently not configured to be highlighted in Algolia.
See https://www.algolia.com/doc/api-reference/api-parameters/attributesToHighlight/.`
);
}

return h('span', {
Expand Down

0 comments on commit 09d8d3d

Please sign in to comment.