Skip to content

Commit

Permalink
Print available worlds in the “multiple worlds” error message (#1654)
Browse files Browse the repository at this point in the history
  • Loading branch information
primoly authored Jul 8, 2024
1 parent b92dd79 commit 1f8e7e2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/wit-parser/src/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1021,8 +1021,9 @@ impl Resolve {
0 => bail!("no worlds found in package `{}`", pkg.name),
1 => return Ok(*pkg.worlds.values().next().unwrap()),
_ => bail!(
"multiple worlds found in package `{}`: one must be explicitly chosen",
pkg.name
"multiple worlds found in package `{}`, one must be explicitly chosen:{}",
pkg.name,
pkg.worlds.keys().map(|name| format!("\n {name}")).collect::<String>()
),
}
}
Expand Down

0 comments on commit 1f8e7e2

Please sign in to comment.