fix: error handling and notifications

This commit is contained in:
Björn Steinhagen
2026-02-03 10:06:46 +02:00
parent e0364ae7af
commit eb03d1ebab
2 changed files with 19 additions and 5 deletions
+18 -3
View File
@@ -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.`
)
+1 -2
View File
@@ -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()