From 415777eca2f7fafef84aa7922bfc553cbe8acbe7 Mon Sep 17 00:00:00 2001 From: Brandon Hulston Date: Wed, 17 Jan 2024 01:19:27 -0700 Subject: [PATCH] Add error catching for import --- src/lib/components/chat/SettingsModal.svelte | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/components/chat/SettingsModal.svelte b/src/lib/components/chat/SettingsModal.svelte index 9da70add..f5c2b06e 100644 --- a/src/lib/components/chat/SettingsModal.svelte +++ b/src/lib/components/chat/SettingsModal.svelte @@ -133,7 +133,11 @@ let chats = JSON.parse(event.target.result); console.log(chats); if (getImportOrigin(chats) == 'gpt') { - chats = convertGptChats(chats); + try { + chats = convertGptChats(chats); + } catch (error) { + console.log("Unable to import chats:", error); + } } importChats(chats); };