Skip to content

Commit 816dc32

Browse files
authored
fix: improve error retreiving cargo metadata (#170)
1 parent ded4af7 commit 816dc32

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/manifest.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,14 @@ export async function getCargoWorkspace(
5050
cwd: directory.toString(),
5151
args: ["metadata", "--format-version", "1", ...cargoFlags],
5252
stdout: "piped",
53+
stderr: "piped",
5354
});
5455
const output = await p.output();
5556
if (!output.success) {
56-
throw new Error("Error retrieving cargo metadata.");
57+
const stderr = new TextDecoder().decode(output.stderr).trim();
58+
throw new Error(
59+
`Error retrieving cargo metadata.\n${stderr}`,
60+
);
5761
}
5862
const result = new TextDecoder().decode(output.stdout);
5963
return new CargoWorkspace(JSON.parse(result!) as CargoMetadata);

0 commit comments

Comments
 (0)