Skip to content

Build your personal knowledge base with Trilium Notes

chore(launch_bar): log warnings instead of crashing on a bad launcher

Elian Doran6b4da3372930
diff --git a/apps/client/src/widgets/launch_bar/LauncherContainer.tsx b/apps/client/src/widgets/launch_bar/LauncherContainer.tsx
index 1319b4eb54..79de559c98 100644
--- a/apps/client/src/widgets/launch_bar/LauncherContainer.tsx
+++ b/apps/client/src/widgets/launch_bar/LauncherContainer.tsx
@@ -67,7 +67,7 @@ function Launcher({ note, isHorizontalLayout }: { note: FNote, isHorizontalLayou
case "builtinWidget":
return initBuiltinWidget(note, isHorizontalLayout);
default:
- throw new Error(`Unrecognized launcher type '${launcherType}' for launcher '${note.noteId}' title '${note.title}'`);
+ console.warn(`Unrecognized launcher type '${launcherType}' for launcher '${note.noteId}' title '${note.title}'`);
}
}
@@ -99,7 +99,7 @@ function initBuiltinWidget(note: FNote, isHorizontalLayout: boolean) {
case "mobileTabSwitcher":
return <TabSwitcher />;
default:
- throw new Error(`Unrecognized builtin widget ${builtinWidget} for launcher ${note.noteId} "${note.title}"`);
+ console.warn(`Unrecognized builtin widget ${builtinWidget} for launcher ${note.noteId} "${note.title}"`);
}
}