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:
Pat Hickey
2020-08-17 17:20:16 -07:00
parent 30b9e69136
commit 19369142cb
3 changed files with 11 additions and 9 deletions

View File

@@ -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()
}
}