mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-30 21:49:53 +00:00
refactor(desktop): improve error handling and translation in server error formatting (#16171)
This commit is contained in:
parent
62909e917a
commit
27baa2d65c
5 changed files with 142 additions and 61 deletions
|
|
@ -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()
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue