From 99ccfe440890425f0eb83d09c91c4f51fa83d73e Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 3 Mar 2026 14:25:05 +0100 Subject: [PATCH] fix: improve error retreiving cargo metadata --- lib/manifest.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/manifest.ts b/lib/manifest.ts index 461b441..d1b421a 100644 --- a/lib/manifest.ts +++ b/lib/manifest.ts @@ -50,10 +50,14 @@ export async function getCargoWorkspace( cwd: directory.toString(), args: ["metadata", "--format-version", "1", ...cargoFlags], stdout: "piped", + stderr: "piped", }); const output = await p.output(); if (!output.success) { - throw new Error("Error retrieving cargo metadata."); + const stderr = new TextDecoder().decode(output.stderr).trim(); + throw new Error( + `Error retrieving cargo metadata.\n${stderr}`, + ); } const result = new TextDecoder().decode(output.stdout); return new CargoWorkspace(JSON.parse(result!) as CargoMetadata);