From eb03d1ebaba6813c3e6b201ae9db7f028e69920e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Steinhagen?= <88777268+bjoernsteinhagen@users.noreply.github.com> Date: Tue, 3 Feb 2026 10:06:46 +0200 Subject: [PATCH] fix: error handling and notifications --- lib/bridge/server.ts | 21 ++++++++++++++++++--- lib/bridge/sketchup.ts | 3 +-- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/lib/bridge/server.ts b/lib/bridge/server.ts index f00fb89..7d80396 100644 --- a/lib/bridge/server.ts +++ b/lib/bridge/server.ts @@ -486,6 +486,11 @@ export class ArchicadBridge { if (canCreateIngestion.queryAvailable) { const ingestionId = hostAppStore.activeIngestions[args.modelCardId] if (!ingestionId) { + hostAppStore.setNotification({ + type: ToastNotificationType.Danger, + title: 'Ingestion Failed', + description: 'Ingestion ID not found to create version.' + }) throw new Error(`Ingestion failed: Ingestion ID not found to create version.`) } @@ -500,10 +505,20 @@ export class ArchicadBridge { } if (res?.statusData.__typename === 'ModelIngestionFailedStatus') { - throw new Error( - `Ingestion failed: ${res?.statusData.errorReason || 'Unknown error'}.` - ) + const errorReason = res?.statusData.errorReason || 'Unknown error' + hostAppStore.setNotification({ + type: ToastNotificationType.Danger, + title: 'Ingestion Failed', + description: errorReason + }) + throw new Error(`Ingestion failed: ${errorReason}.`) } + + hostAppStore.setNotification({ + type: ToastNotificationType.Danger, + title: 'Ingestion Error', + description: 'Ingestion status does not match expected types.' + }) throw new Error( `Ingestion status does not match with the expected types as success or failure.` ) diff --git a/lib/bridge/sketchup.ts b/lib/bridge/sketchup.ts index 3b9a560..f607993 100644 --- a/lib/bridge/sketchup.ts +++ b/lib/bridge/sketchup.ts @@ -329,8 +329,7 @@ export class SketchupBridge extends BaseBridge { ) if (!modelCard) { - // TODO: Throw - return + throw new Error('Model card not found') // ctor } const { canCreateModelIngestion } = useCheckGraphql()