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

Commit

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

return h('span', {
Expand Down

0 comments on commit 6988cb2

Please sign in to comment.