Path: blob/main/crates/wiggle/src/guest_error.rs
3054 views
use crate::Region;1use thiserror::Error;23#[derive(Debug, Error, PartialEq, Eq)]4pub enum GuestError {5#[error("Invalid flag value {0}")]6InvalidFlagValue(&'static str),7#[error("Invalid enum value {0}")]8InvalidEnumValue(&'static str),9#[error("Pointer overflow")]10PtrOverflow,11#[error("Pointer out of bounds: {0:?}")]12PtrOutOfBounds(Region),13#[error("Pointer not aligned to {1}: {0:?}")]14PtrNotAligned(Region, u32),15#[error("Slice length mismatch")]16SliceLengthsDiffer,17#[error("In func {modulename}::{funcname} at {location}: {err}")]18InFunc {19modulename: &'static str,20funcname: &'static str,21location: &'static str,22#[source]23err: Box<GuestError>,24},25#[error("Invalid UTF-8 encountered: {0:?}")]26InvalidUtf8(#[from] ::std::str::Utf8Error),27#[error("Int conversion error: {0:?}")]28TryFromIntError(#[from] ::std::num::TryFromIntError),29}303132