Skip to content

Commit

Permalink
Add context to metadata parse error
Browse files Browse the repository at this point in the history
  • Loading branch information
laundmo authored and abonander committed Feb 21, 2023
1 parent c4130d4 commit c4a2e73
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sqlx-cli/src/prepare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,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.
Expand Down

0 comments on commit c4a2e73

Please sign in to comment.