Skip to content

Commit 2d1fa71

Browse files
committed
throw instead of warn
1 parent f1a2ccb commit 2d1fa71

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/components/sidebar/dynamicNav.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,7 @@ export function DynamicNav({
132132
rootBits.forEach(bit => {
133133
entity = currentTree.find(n => n.name === bit);
134134
if (!entity) {
135-
// eslint-disable-next-line no-console
136-
console.warn(`Could not find entity at ${root} (specifically at ${bit})`);
137-
return;
135+
throw new Error(`Could not find entity at ${root} (specifically at ${bit})`);
138136
}
139137
currentTree = entity.children;
140138
});
@@ -147,9 +145,7 @@ export function DynamicNav({
147145
const parentNode = entity.children?.find((n: EntityTree) => n.name === '');
148146

149147
if (!parentNode) {
150-
// eslint-disable-next-line no-console
151-
console.warn(`Could not find parentNode at ${root}`);
152-
return null;
148+
throw new Error(`Could not find parentNode at ${root}`);
153149
}
154150

155151
const {path} = serverContext();

0 commit comments

Comments
 (0)