Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 42 additions & 14 deletions src/assistant.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,17 @@ export async function openAssistantForm({
view.outputs = finishedTask?.output
}
} else if (finishedTask.status === TASK_STATUS_STRING.failed) {
showError(
t('assistant', 'The server failed to process your task with ID {id}', { id: finishedTask.id })
+ '. ' + t('assistant', 'Please inform the server administrators of this issue.'),
)
if (finishedTask.userFacingErrorMessage) {
showError(
t('assistant', 'The server failed to process your task with ID {id}', { id: finishedTask.id })
+ ': ' + finishedTask.userFacingErrorMessage,
)
} else {
showError(
t('assistant', 'The server failed to process your task with ID {id}', { id: finishedTask.id })
+ '. ' + t('assistant', 'Please inform the server administrators of this issue.'),
)
}
console.error('[assistant] Task failed', finishedTask)
view.outputs = null
}
Expand Down Expand Up @@ -220,10 +227,17 @@ export async function openAssistantForm({
view.outputs = finishedTask?.output
view.selectedTaskId = finishedTask?.id
} else if (finishedTask.status === TASK_STATUS_STRING.failed) {
showError(
t('assistant', 'The server failed to process your task with ID {id}', { id: finishedTask.id })
+ '. ' + t('assistant', 'Please inform the server administrators of this issue.'),
)
if (finishedTask.userFacingErrorMessage) {
showError(
t('assistant', 'The server failed to process your task with ID {id}', { id: finishedTask.id })
+ ': ' + finishedTask.userFacingErrorMessage,
)
} else {
showError(
t('assistant', 'The server failed to process your task with ID {id}', { id: finishedTask.id })
+ '. ' + t('assistant', 'Please inform the server administrators of this issue.'),
)
}
console.error('[assistant] Task failed', finishedTask)
view.outputs = null
}
Expand Down Expand Up @@ -564,10 +578,17 @@ export async function openAssistantTask(
if (finishedTask.status === TASK_STATUS_STRING.successful) {
view.outputs = finishedTask?.output
} else if (finishedTask.status === TASK_STATUS_STRING.failed) {
showError(
t('assistant', 'The server failed to process your task with ID {id}', { id: finishedTask.id })
if (finishedTask.userFacingErrorMessage) {
showError(
t('assistant', 'The server failed to process your task with ID {id}', { id: finishedTask.id })
+ ': ' + finishedTask.userFacingErrorMessage,
)
} else {
showError(
t('assistant', 'The server failed to process your task with ID {id}', { id: finishedTask.id })
+ '. ' + t('assistant', 'Please inform the server administrators of this issue.'),
)
)
}
console.error('[assistant] Task failed', finishedTask)
view.outputs = null
}
Expand Down Expand Up @@ -645,10 +666,17 @@ export async function openAssistantTask(
view.outputs = finishedTask?.output
view.selectedTaskId = finishedTask?.id
} else if (finishedTask.status === TASK_STATUS_STRING.failed) {
showError(
t('assistant', 'The server failed to process your task with ID {id}', { id: finishedTask.id })
if (finishedTask.userFacingErrorMessage) {
showError(
t('assistant', 'The server failed to process your task with ID {id}', { id: finishedTask.id })
+ ': ' + finishedTask.userFacingErrorMessage,
)
} else {
showError(
t('assistant', 'The server failed to process your task with ID {id}', { id: finishedTask.id })
+ '. ' + t('assistant', 'Please inform the server administrators of this issue.'),
)
)
}
console.error('[assistant] Task failed', finishedTask)
view.outputs = null
}
Expand Down