fix: address Copilot review round 1 (#2333)
A runner that threw ETIMEDOUT landed in the catch and read as
unavailable, bypassing the split the previous commit added. The thrown
error is now normalized onto the `{ error }` path so the timeout check
covers both shapes; a test pins the thrown case.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PsmUAZ6aLUAFqenjJKSSRp
Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
parent
3f7ba20ae6
commit
e0cd94b03e
1 changed files with 15 additions and 3 deletions
|
|
@ -165,9 +165,12 @@ export function probeScriptVersion(
|
|||
let r;
|
||||
try {
|
||||
r = runner("script", ["--version"]);
|
||||
} catch {
|
||||
// A runner that throws outright (injected, or a future spawn shape).
|
||||
return { available: false, output: "" };
|
||||
} catch (err) {
|
||||
// A runner that throws outright (injected, or a future spawn shape) is
|
||||
// normalized onto the same path as one that returns `{ error }`, so the
|
||||
// timeout check below applies to both shapes — a thrown ETIMEDOUT must not
|
||||
// slip back into "unavailable" (Copilot, #2333).
|
||||
r = { error: err };
|
||||
}
|
||||
if (r?.error?.code === "ETIMEDOUT") {
|
||||
throw new Error(
|
||||
|
|
|
|||
Loading…
Reference in a new issue