refactor(desktop): improve error handling and translation in server error formatting (#16171)

This commit is contained in:
OpeOginni
2026-03-05 13:28:17 +01:00
committed by GitHub
parent 62909e917a
commit 27baa2d65c
5 changed files with 142 additions and 61 deletions

View File

@@ -16,6 +16,7 @@ import { Identifier } from "@/utils/id"
import { Worktree as WorktreeState } from "@/utils/worktree"
import { buildRequestParts } from "./build-request-parts"
import { setCursorPosition } from "./editor-dom"
import { formatServerError } from "@/utils/server-errors"
type PendingPrompt = {
abort: AbortController
@@ -286,7 +287,7 @@ export function createPromptSubmit(input: PromptSubmitInput) {
.catch((err) => {
showToast({
title: language.t("prompt.toast.commandSendFailed.title"),
description: errorMessage(err),
description: formatServerError(err, language.t, language.t("common.requestFailed")),
})
restoreInput()
})