From e91039dfab9115f9d987bb10194cdde546e397f7 Mon Sep 17 00:00:00 2001 From: Martin Sottnik Date: Sun, 8 Sep 2024 22:10:54 +0200 Subject: [PATCH] supress uc errors in device query --- src/schema/device.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/schema/device.ts b/src/schema/device.ts index f7af0323..bb631e58 100644 --- a/src/schema/device.ts +++ b/src/schema/device.ts @@ -116,9 +116,14 @@ export const Device = objectType({ t.nonNull.boolean('isInstalled', { resolve: async (root, _, { prisma }) => { const { uniconfigZoneId } = root; - const uniconfigURL = await getUniconfigURL(prisma, uniconfigZoneId); - const isInstalled = await getCachedDeviceInstallStatus(uniconfigURL, root.name); - return isInstalled; + try { + const uniconfigURL = await getUniconfigURL(prisma, uniconfigZoneId); + const isInstalled = await getCachedDeviceInstallStatus(uniconfigURL, root.name); + return isInstalled; + } catch { + // FD-683 supress isInstalled error when something is wrong with uniconfig + return false; + } }, }); t.nonNull.field('zone', {