From 1c56dc079bca44cedc4e06e97f270e304fb19f06 Mon Sep 17 00:00:00 2001 From: bootunloader Date: Sun, 22 Sep 2024 10:06:52 +0300 Subject: [PATCH] guard --- src/routes/admin/fs-modal.svelte | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/routes/admin/fs-modal.svelte b/src/routes/admin/fs-modal.svelte index 1b5c74a..110b8be 100755 --- a/src/routes/admin/fs-modal.svelte +++ b/src/routes/admin/fs-modal.svelte @@ -62,12 +62,15 @@ toast.success("Data posted successfully"); }, onError: (e) => { - // @ts-ignore - if (e.detail) { + try { // @ts-ignore - return toast.error(e.detail); + if (e.detail) { + // @ts-ignore + return toast.error(e.detail); + } + } catch (e) { + console.error(e); } - console.error(e); toast.error("Error posting data"); }, });