From 8bd6ab9d7384ab2effc0165ebeffb1d92401df03 Mon Sep 17 00:00:00 2001 From: laundmo Date: Tue, 22 Nov 2022 22:15:38 +0100 Subject: [PATCH] Add context to metadata parse error --- sqlx-cli/src/prepare.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sqlx-cli/src/prepare.rs b/sqlx-cli/src/prepare.rs index f934ed3c52..014b1f0d22 100644 --- a/sqlx-cli/src/prepare.rs +++ b/sqlx-cli/src/prepare.rs @@ -118,7 +118,9 @@ hint: This command only works in the manifest directory of a Cargo package."# let output_str = std::str::from_utf8(&output.stdout).context("Invalid `cargo metadata` output")?; - let metadata: Metadata = output_str.parse()?; + let metadata: Metadata = output_str.parse().context( + "Issue parsing `cargo metadata` output - consider manually running it to check for issues", + )?; // try removing the target/sqlx directory before running, as stale files // have repeatedly caused issues in the past.