Use wiggle "trappable error" to implement wasi-common (#5279)
* convert wasi-common from defining its own error to using wiggle trappable error * wasi-common impl crates: switch error strategy * wasmtime-wasi: error is trappable, and no longer requires UserErrorConversion * docs * typo * readdir: windows fixes * fix windows scheduler errors fun fact! the Send and Recv errors here that just had a `.context` on them were previously not being captured in the downcasting either. They need to be traps, and would have ended up that way by ommission, but you'd never actually know that by reading the code!
This commit is contained in:
@@ -128,7 +128,9 @@ macro_rules! wasi_file_write_impl {
|
||||
}
|
||||
async fn write_vectored<'a>(&mut self, bufs: &[io::IoSlice<'a>]) -> Result<u64, Error> {
|
||||
let n = (&*self.0.as_filelike_view::<File>()).write_vectored(bufs)?;
|
||||
Ok(n.try_into().map_err(|c| Error::range().context(c))?)
|
||||
Ok(n.try_into().map_err(|_| {
|
||||
Error::range().context("converting write_vectored total length")
|
||||
})?)
|
||||
}
|
||||
async fn write_vectored_at<'a>(
|
||||
&mut self,
|
||||
|
||||
Reference in New Issue
Block a user