| @@ -5,6 +5,7 @@ import { · 4 unmodified lines |
| 5 | } from "@t3tools/contracts"; | 5 | } from "@t3tools/contracts"; |
| 6 | import { | 6 | import { |
| 7 | SshCommandSpawnError, | 7 | SshCommandSpawnError, |
| | 8 | SshCommandTimeoutError, |
| 8 | SshHttpBridgeError, | 9 | SshHttpBridgeError, |
| 9 | SshPasswordPromptError, | 10 | SshPasswordPromptError, |
| 10 | } from "@t3tools/ssh/errors"; | 11 | } from "@t3tools/ssh/errors"; |
| @@ -22,7 +23,7 @@ import { · 11 unmodified lines |
| 22 | DesktopSshEnvironmentRequestError, | 23 | DesktopSshEnvironmentRequestError, |
| 23 | ensureSshEnvironment, | 24 | ensureSshEnvironment, |
| 24 | fetchSshEnvironmentDescriptor, | 25 | fetchSshEnvironmentDescriptor, |
| 25 | toDesktopSshOperationPresentationError, | 26 | toDesktopSshIpcPresentationError, |
| 26 | } from "./sshEnvironment.ts"; | 27 | } from "./sshEnvironment.ts"; |
| 27 | import * as DesktopSshEnvironment from "../../ssh/DesktopSshEnvironment.ts"; | 28 | import * as DesktopSshEnvironment from "../../ssh/DesktopSshEnvironment.ts"; |
| 28 | import * as DesktopSshPasswordPrompts from "../../ssh/DesktopSshPasswordPrompts.ts"; | 29 | import * as DesktopSshPasswordPrompts from "../../ssh/DesktopSshPasswordPrompts.ts"; |
| @@ -102,12 +103,23 @@ describe("SSH environment IPC", () => { · 73 unmodified lines |
| 102 | cause, | 103 | cause, |
| 103 | }); | 104 | }); |
| 104 | | 105 | |
| 105 | const presentation = toDesktopSshOperationPresentationError(structured); | 106 | const presentation = toDesktopSshIpcPresentationError(structured); |
| 106 | assert.equal(structured.message, "Failed to spawn SSH command for devbox."); | 107 | assert.equal(structured.message, "Failed to spawn SSH command for devbox."); |
| 107 | assert.equal(presentation.message, cause.message); | 108 | assert.equal(presentation.message, cause.message); |
| 108 | assert.strictEqual(presentation.cause, structured); | 109 | assert.strictEqual(presentation.cause, structured); |
| 109 | }); | 110 | }); |
| 110 | | 111 | |
| | 112 | it("passes structural SSH errors without process causes through the IPC boundary", () => { |
| | 113 | const structured = new SshCommandTimeoutError({ |
| | 114 | command: "ssh", |
| | 115 | argumentCount: 0, |
| | 116 | target: "devbox", |
| | 117 | timeoutMs: 30_000, |
| | 118 | }); |
| | 119 | |
| | 120 | assert.strictEqual(toDesktopSshIpcPresentationError(structured), structured); |
| | 121 | }); |
| | 122 | |
| 111 | it.effect("fetches and decodes the remote environment descriptor", () => { | 123 | it.effect("fetches and decodes the remote environment descriptor", () => { |
| 112 | const requestUrls: string[] = []; | 124 | const requestUrls: string[] = []; |
| 113 | const layer = makeHttpClientLayer((request) => | 125 | const layer = makeHttpClientLayer((request) => |