From 0759a3607c3f3c433cf1ac8ec3bbf04241c1f54c Mon Sep 17 00:00:00 2001 From: Henry Dollman Date: Fri, 31 Jan 2025 17:16:21 -0500 Subject: [PATCH] supress pocketbase auto cancellation error --- beszel/site/src/lib/utils.ts | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/beszel/site/src/lib/utils.ts b/beszel/site/src/lib/utils.ts index b7b9c0b..83390f5 100644 --- a/beszel/site/src/lib/utils.ts +++ b/beszel/site/src/lib/utils.ts @@ -43,13 +43,20 @@ const verifyAuth = () => { } export const updateSystemList = async () => { - const records = await pb - .collection("systems") - .getFullList({ sort: "+name", fields: "id,name,host,info,status" }) - if (records.length) { - $systems.set(records) - } else { - verifyAuth() + try { + const records = await pb + .collection("systems") + .getFullList({ sort: "+name", fields: "id,name,host,info,status" }) + if (records.length) { + $systems.set(records) + } else { + verifyAuth() + } + } catch (err) { + // @ts-ignore supress pocketbase auto cancellation error + if (err.isAbort) { + return + } } }