@@ -149,7 +149,16 @@ export async function openAssistantForm({
149
149
view . showSyncTaskRunning = false
150
150
emit ( 'assistant:task:updated' , finishedTask )
151
151
} ) . catch ( error => {
152
- console . debug ( '[assistant] poll error' , error )
152
+ console . debug ( '[assistant] poll error' , error . message )
153
+ if ( error . message === 'task-not-found' ) {
154
+ view . loading = false
155
+ view . showSyncTaskRunning = false
156
+ view . isNotifyEnabled = false
157
+ view . outputs = null
158
+ view . selectedTaskId = null
159
+ lastTask = null
160
+ showError ( t ( 'assistant' , 'The current Assistant task could not be found' ) )
161
+ }
153
162
} )
154
163
} )
155
164
. catch ( error => {
@@ -228,6 +237,15 @@ export async function openAssistantForm({
228
237
emit ( 'assistant:task:updated' , finishedTask )
229
238
} ) . catch ( error => {
230
239
console . debug ( '[assistant] poll error' , error )
240
+ if ( error . message === 'task-not-found' ) {
241
+ view . loading = false
242
+ view . showSyncTaskRunning = false
243
+ view . isNotifyEnabled = false
244
+ view . outputs = null
245
+ view . selectedTaskId = null
246
+ lastTask = null
247
+ showError ( t ( 'assistant' , 'The current Assistant task could not be found' ) )
248
+ }
231
249
} )
232
250
} ) . catch ( error => {
233
251
console . error ( error )
@@ -289,6 +307,11 @@ export async function pollTask(taskId, setProgress) {
289
307
}
290
308
} ) . catch ( error => {
291
309
console . debug ( '[assistant] poll request failed' , error )
310
+ if ( error . status === 404 ) {
311
+ clearInterval ( window . assistantPollTimerId )
312
+ reject ( new Error ( 'task-not-found' ) )
313
+ return
314
+ }
292
315
reject ( new Error ( 'pollTask request failed' ) )
293
316
} )
294
317
} , 2000 )
@@ -543,6 +566,14 @@ export async function openAssistantTask(
543
566
} ) . catch ( error => {
544
567
console . debug ( '[assistant] poll error' , error )
545
568
view . outputs = null
569
+ if ( error . message === 'task-not-found' ) {
570
+ view . loading = false
571
+ view . showSyncTaskRunning = false
572
+ view . isNotifyEnabled = false
573
+ view . selectedTaskId = null
574
+ lastTask = null
575
+ showError ( t ( 'assistant' , 'The current Assistant task could not be found' ) )
576
+ }
546
577
} )
547
578
} )
548
579
. catch ( error => {
@@ -618,6 +649,15 @@ export async function openAssistantTask(
618
649
emit ( 'assistant:task:updated' , finishedTask )
619
650
} ) . catch ( error => {
620
651
console . debug ( '[assistant] poll error' , error )
652
+ if ( error . message === 'task-not-found' ) {
653
+ view . loading = false
654
+ view . showSyncTaskRunning = false
655
+ view . isNotifyEnabled = false
656
+ view . outputs = null
657
+ view . selectedTaskId = null
658
+ lastTask = null
659
+ showError ( t ( 'assistant' , 'The current Assistant task could not be found' ) )
660
+ }
621
661
} )
622
662
} ) . catch ( error => {
623
663
console . error ( error )
0 commit comments