fix(doctor): align sandbox image check with main logic
Updated `dockerImageExists` in `src/commands/doctor-sandbox.ts` to mirror the logic in `src/agents/sandbox/docker.ts`. It now re-throws errors unless they are explicitly "No such image" errors.
This commit is contained in:
committed by
Peter Steinberger
parent
b5f1dc9d95
commit
ed560e466f
@@ -78,8 +78,12 @@ async function dockerImageExists(image: string): Promise<boolean> {
|
|||||||
try {
|
try {
|
||||||
await runExec("docker", ["image", "inspect", image], { timeoutMs: 5_000 });
|
await runExec("docker", ["image", "inspect", image], { timeoutMs: 5_000 });
|
||||||
return true;
|
return true;
|
||||||
} catch {
|
} catch (error: any) {
|
||||||
return false;
|
const stderr = error?.stderr || error?.message || "";
|
||||||
|
if (String(stderr).includes("No such image")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user