diff options
Diffstat (limited to 'crates/core/src/error.rs')
| -rw-r--r-- | crates/core/src/error.rs | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/crates/core/src/error.rs b/crates/core/src/error.rs deleted file mode 100644 index b9c93c4..0000000 --- a/crates/core/src/error.rs +++ /dev/null @@ -1,28 +0,0 @@ -use alloc::string::{String, ToString}; -use thiserror::Error; - -#[derive(Debug, Error)] -pub enum Error { - #[error("error parsing module")] - ParseError { message: String, offset: usize }, - - #[error("unknown error: {0}")] - Other(String), -} - -impl Error { - pub fn other<T>(message: &str) -> Result<T, Self> { - Err(Self::Other(message.to_string())) - } -} - -impl From<wasmparser::BinaryReaderError> for Error { - fn from(value: wasmparser::BinaryReaderError) -> Self { - Self::ParseError { - message: value.message().to_string(), - offset: value.offset(), - } - } -} - -pub type Result<T, E = Error> = crate::std::result::Result<T, E>; |
