Skip to content
Open
Show file tree
Hide file tree
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
15 changes: 13 additions & 2 deletions src/core/webview/ClineProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1511,8 +1511,19 @@ export class ClineProvider
async showTaskWithId(id: string) {
if (id !== this.getCurrentTask()?.taskId) {
// Non-current task.
const { historyItem } = await this.getTaskWithId(id)
await this.createTaskWithHistoryItem(historyItem) // Clears existing task.
try {
const { historyItem } = await this.getTaskWithId(id)
await this.createTaskWithHistoryItem(historyItem) // Clears existing task.
} catch (error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding error logging here for debugging purposes:

This would help track down issues in production when tasks fail to load.

// Log the error for debugging purposes
this.log(`Failed to load task ${id}: ${error instanceof Error ? error.message : String(error)}`)

// Task not found or corrupt - it has already been deleted from state by getTaskWithId
vscode.window.showErrorMessage(t("common:errors.task_corrupt_deleted"))
// Refresh the webview to update the task list
await this.postStateToWebview()
return
}
}

await this.postMessageToWebview({ type: "action", action: "chatButtonClicked" })
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/locales/ca/common.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading