Skip to content

Commit

Permalink
Better error message when including broken packages
Browse files Browse the repository at this point in the history
  • Loading branch information
john-sharratt committed Jul 31, 2023
1 parent da0f271 commit a225f47
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/wasi-web/wasmer.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "wasmer/wasmer-sh"
version = "0.2.21"
version = "0.2.24"
description = "Container that holds the wasmer.sh website."

[dependencies]
"wasmer/static-web-server-async" = "1"
"wasmer/static-web-server" = "1"

[fs]
public = "dist"
Expand Down
19 changes: 14 additions & 5 deletions lib/wasix/src/state/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -947,11 +947,20 @@ impl WasiEnv {
let rt = self.runtime();

for package_name in uses {
let specifier = package_name
.parse::<PackageSpecifier>()
.map_err(|e| WasiStateCreationError::WasiIncludePackageError(e.to_string()))?;
let pkg = InlineWaker::block_on(BinaryPackage::from_registry(&specifier, rt))
.map_err(|e| WasiStateCreationError::WasiIncludePackageError(e.to_string()))?;
let specifier = package_name.parse::<PackageSpecifier>().map_err(|e| {
WasiStateCreationError::WasiIncludePackageError(format!(
"package_name={package_name}, {}",
e.to_string()
))
})?;
let pkg = InlineWaker::block_on(BinaryPackage::from_registry(&specifier, rt)).map_err(
|e| {
WasiStateCreationError::WasiIncludePackageError(format!(
"package_name={package_name}, {}",
e.to_string()
))
},
)?;
self.use_package(&pkg)?;
}

Expand Down

0 comments on commit a225f47

Please sign in to comment.