Migrate UI cancel error to tagged error (#27112)

This commit is contained in:
Kit Langton
2026-05-12 14:09:00 -04:00
committed by GitHub
parent fda37b3609
commit 3974520742
4 changed files with 10 additions and 10 deletions

View File

@@ -1,6 +1,7 @@
import { describe, expect, test } from "bun:test"
import { AccountTransportError } from "../../src/account/schema"
import { FormatError } from "../../src/cli/error"
import { UI } from "../../src/cli/ui"
describe("cli.error", () => {
test("formats account transport errors clearly", () => {
@@ -15,4 +16,8 @@ describe("cli.error", () => {
expect(formatted).toContain("This failed before the server returned an HTTP response.")
expect(formatted).toContain("Check your network, proxy, or VPN configuration and try again.")
})
test("formats cancelled UI errors as empty output", () => {
expect(FormatError(new UI.CancelledError())).toBe("")
})
})