summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--packages/opencode/src/cli/error.ts3
-rw-r--r--packages/opencode/src/index.ts2
2 files changed, 4 insertions, 1 deletions
diff --git a/packages/opencode/src/cli/error.ts b/packages/opencode/src/cli/error.ts
index bb7186e88..752ad6964 100644
--- a/packages/opencode/src/cli/error.ts
+++ b/packages/opencode/src/cli/error.ts
@@ -1,5 +1,6 @@
import { Config } from "../config/config"
import { MCP } from "../mcp"
+import { UI } from "./ui"
export function FormatError(input: unknown) {
if (MCP.Failed.isInstance(input))
@@ -13,4 +14,6 @@ export function FormatError(input: unknown) {
(issue) => "↳ " + issue.message + " " + issue.path.join("."),
) ?? []),
].join("\n")
+
+ if (UI.CancelledError.isInstance(input)) return ""
}
diff --git a/packages/opencode/src/index.ts b/packages/opencode/src/index.ts
index 089f17b0e..54b530955 100644
--- a/packages/opencode/src/index.ts
+++ b/packages/opencode/src/index.ts
@@ -170,7 +170,7 @@ try {
Log.Default.error("fatal", data)
const formatted = FormatError(e)
if (formatted) UI.error(formatted)
- if (!formatted)
+ if (formatted === undefined)
UI.error(
"Unexpected error, check log file at " + Log.file() + " for more details",
)