mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-22 10:14:22 +01:00
do not print error on ctrl+c during prompts
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import { Config } from "../config/config"
|
import { Config } from "../config/config"
|
||||||
import { MCP } from "../mcp"
|
import { MCP } from "../mcp"
|
||||||
|
import { UI } from "./ui"
|
||||||
|
|
||||||
export function FormatError(input: unknown) {
|
export function FormatError(input: unknown) {
|
||||||
if (MCP.Failed.isInstance(input))
|
if (MCP.Failed.isInstance(input))
|
||||||
@@ -13,4 +14,6 @@ export function FormatError(input: unknown) {
|
|||||||
(issue) => "↳ " + issue.message + " " + issue.path.join("."),
|
(issue) => "↳ " + issue.message + " " + issue.path.join("."),
|
||||||
) ?? []),
|
) ?? []),
|
||||||
].join("\n")
|
].join("\n")
|
||||||
|
|
||||||
|
if (UI.CancelledError.isInstance(input)) return ""
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ try {
|
|||||||
Log.Default.error("fatal", data)
|
Log.Default.error("fatal", data)
|
||||||
const formatted = FormatError(e)
|
const formatted = FormatError(e)
|
||||||
if (formatted) UI.error(formatted)
|
if (formatted) UI.error(formatted)
|
||||||
if (!formatted)
|
if (formatted === undefined)
|
||||||
UI.error(
|
UI.error(
|
||||||
"Unexpected error, check log file at " + Log.file() + " for more details",
|
"Unexpected error, check log file at " + Log.file() + " for more details",
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user