Skip to content

Commit 148bfe4

Browse files
committed
[ResourcesBySelector] Error if no resources found
1 parent ee87b3b commit 148bfe4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/components/ResourcesBySelector.astro

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ const resources: Array<CollectionEntry<"docs"> | CollectionEntry<"stream">> = [
5252
);
5353
});
5454
55+
if (resources.length < 1) {
56+
throw new Error(
57+
`[ResourcesBySelector] Couldn't resources related to your filtered options`,
58+
);
59+
}
60+
5561
const facets = resources.reduce(
5662
(acc, page) => {
5763
if (!filterables) return acc;

0 commit comments

Comments
 (0)