Improve error messages on extension loading (#42266)
This pull request improves error message when extension loading goes
wrong.
Before:
```
2025-11-08T21:16:02+08:00 ERROR [extension_host::extension_host] failed to load arkts extension.toml
Caused by:
No such file or directory (os error 2)
```
Now:
```
2025-11-08T22:57:00+08:00 ERROR [extension_host::extension_host] failed to load arkts extension.toml, "/Users/user_name_placeholder/Library/Application Support/Zed/extensions/installed/arkts/extension.toml"
Caused by:
No such file or directory (os error 2)
```
Release Notes:
- N/A
This commit is contained in:
@@ -763,17 +763,17 @@ impl WasmExtension {
|
||||
.fs
|
||||
.open_sync(&path)
|
||||
.await
|
||||
.context("failed to open wasm file")?;
|
||||
.context(format!("opening wasm file, path: {path:?}"))?;
|
||||
|
||||
let mut wasm_bytes = Vec::new();
|
||||
wasm_file
|
||||
.read_to_end(&mut wasm_bytes)
|
||||
.context("failed to read wasm")?;
|
||||
.context(format!("reading wasm file, path: {path:?}"))?;
|
||||
|
||||
wasm_host
|
||||
.load_extension(wasm_bytes, manifest, cx)
|
||||
.await
|
||||
.with_context(|| format!("failed to load wasm extension {}", manifest.id))
|
||||
.with_context(|| format!("loading wasm extension: {}", manifest.id))
|
||||
}
|
||||
|
||||
pub async fn call<T, Fn>(&self, f: Fn) -> Result<T>
|
||||
|
||||
Reference in New Issue
Block a user