wasi-common: trace and convert error
this is a bug - the TODO was never resolved, even when the code to implement it was added right below :) tracing is already in the transitive deps via wiggle, so no extra trouble there. tracing::debug is more appropriate than eprintln
This commit is contained in:
@@ -27,6 +27,7 @@ filetime = "0.2.7"
|
||||
lazy_static = "1.4.0"
|
||||
wig = { path = "wig", version = "0.19.0" }
|
||||
wiggle = { path = "../wiggle", default-features = false, version = "0.19.0" }
|
||||
tracing = "0.1.19"
|
||||
|
||||
[target.'cfg(unix)'.dependencies]
|
||||
yanix = { path = "yanix", version = "0.19.0" }
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
//! pointer or `usize`-sized data are excluded here, so this file only contains
|
||||
//! fixed-size types, so it's host/target independent.
|
||||
use crate::WasiCtx;
|
||||
use tracing::debug;
|
||||
|
||||
wiggle::from_witx!({
|
||||
witx: ["WASI/phases/snapshot/witx/wasi_snapshot_preview1.witx"],
|
||||
@@ -19,9 +20,8 @@ impl wiggle::GuestErrorType for Errno {
|
||||
|
||||
impl types::GuestErrorConversion for WasiCtx {
|
||||
fn into_errno(&self, e: wiggle::GuestError) -> Errno {
|
||||
eprintln!("Guest error: {:?}", e);
|
||||
// TODO proper error mapping
|
||||
Errno::Inval
|
||||
debug!("Guest error: {:?}", e);
|
||||
e.into()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user