From 8fd5006b6fe8536275af6f17e420ad4a669374d0 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Mon, 11 Aug 2025 17:01:18 +0400 Subject: [PATCH] refac --- src/lib/components/chat/Chat.svelte | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 56508e5823..98a492ccfc 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -1785,13 +1785,17 @@ ).catch(async (error) => { console.log(error); - let errorMessage = $i18n.t(`Uh-oh! There was an issue with the response.`); + let errorMessage = error; if (error?.error?.message) { errorMessage = error.error.message; } else if (error?.message) { errorMessage = error.message; } + if (typeof errorMessage === 'object') { + errorMessage = $i18n.t(`Uh-oh! There was an issue with the response.`); + } + toast.error(`${errorMessage}`); responseMessage.error = { content: error