wiggle-using crates: delete GuestErrorConversion
This commit is contained in:
@@ -24,14 +24,6 @@ impl wiggle::GuestErrorType for types::Errno {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl types::GuestErrorConversion for WasiCtx {
|
|
||||||
fn into_errno(&self, e: wiggle::GuestError) -> types::Errno {
|
|
||||||
debug!("Guest error: {:?}", e);
|
|
||||||
let snapshot1_errno: snapshot1_types::Errno = e.into();
|
|
||||||
snapshot1_errno.into()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl types::UserErrorConversion for WasiCtx {
|
impl types::UserErrorConversion for WasiCtx {
|
||||||
fn errno_from_error(&self, e: Error) -> Result<types::Errno, wiggle::Trap> {
|
fn errno_from_error(&self, e: Error) -> Result<types::Errno, wiggle::Trap> {
|
||||||
debug!("Error: {:?}", e);
|
debug!("Error: {:?}", e);
|
||||||
|
|||||||
@@ -30,13 +30,6 @@ impl wiggle::GuestErrorType for types::Errno {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl types::GuestErrorConversion for WasiCtx {
|
|
||||||
fn into_errno(&self, e: wiggle::GuestError) -> types::Errno {
|
|
||||||
debug!("Guest error: {:?}", e);
|
|
||||||
e.into()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl types::UserErrorConversion for WasiCtx {
|
impl types::UserErrorConversion for WasiCtx {
|
||||||
fn errno_from_error(&self, e: Error) -> Result<types::Errno, wiggle::Trap> {
|
fn errno_from_error(&self, e: Error) -> Result<types::Errno, wiggle::Trap> {
|
||||||
debug!("Error: {:?}", e);
|
debug!("Error: {:?}", e);
|
||||||
|
|||||||
@@ -52,13 +52,6 @@ impl<'a> wiggle::GuestErrorType for guest_types::CryptoErrno {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl guest_types::GuestErrorConversion for WasiCryptoCtx {
|
|
||||||
fn into_crypto_errno(&self, e: wiggle::GuestError) -> guest_types::CryptoErrno {
|
|
||||||
eprintln!("GuestError (witx) {:?}", e);
|
|
||||||
guest_types::CryptoErrno::GuestError
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl From<wiggle::GuestError> for guest_types::CryptoErrno {
|
impl From<wiggle::GuestError> for guest_types::CryptoErrno {
|
||||||
fn from(e: wiggle::GuestError) -> Self {
|
fn from(e: wiggle::GuestError) -> Self {
|
||||||
eprintln!("GuestError (impl) {:?}", e);
|
eprintln!("GuestError (impl) {:?}", e);
|
||||||
|
|||||||
@@ -10,16 +10,6 @@ wiggle::from_witx!({
|
|||||||
|
|
||||||
use types::NnErrno;
|
use types::NnErrno;
|
||||||
|
|
||||||
/// Wiggle generates code that performs some input validation on the arguments passed in by users of
|
|
||||||
/// wasi-nn. Here we convert the validation error into one (or more, eventually) of the error
|
|
||||||
/// variants defined in the witx.
|
|
||||||
impl types::GuestErrorConversion for WasiNnCtx {
|
|
||||||
fn into_nn_errno(&self, e: wiggle::GuestError) -> NnErrno {
|
|
||||||
eprintln!("Guest error: {:?}", e);
|
|
||||||
NnErrno::InvalidArgument
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a> types::UserErrorConversion for WasiNnCtx {
|
impl<'a> types::UserErrorConversion for WasiNnCtx {
|
||||||
fn nn_errno_from_wasi_nn_error(&self, e: WasiNnError) -> Result<NnErrno, wiggle::Trap> {
|
fn nn_errno_from_wasi_nn_error(&self, e: WasiNnError) -> Result<NnErrno, wiggle::Trap> {
|
||||||
eprintln!("Host error: {:?}", e);
|
eprintln!("Host error: {:?}", e);
|
||||||
|
|||||||
Reference in New Issue
Block a user