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

Commit

Permalink
fix(store): catch errors on facet values retrieval
Browse files Browse the repository at this point in the history
Closes: #184
  • Loading branch information
rayrutjes committed Jul 21, 2017
1 parent 2b02c19 commit a51a547
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,15 @@ export class Store {
return [];
}

// Todo: make sure the attribute is already added.
// Todo: Not sure this should be here because will make it very hard to debug I suppose.
let values;
try {
values = this._helper.lastResults.getFacetValues(attribute, {
sortBy,
});
} catch (e) {
values = [];
}

const values = this._helper.lastResults.getFacetValues(attribute, {
sortBy,
});
if (limit === -1) {
return values;
}
Expand Down

0 comments on commit a51a547

Please sign in to comment.