Files
wasmtime/crates/api/src/trap.rs
Dan Gohman 22641de629 Initial reorg.
This is largely the same as #305, but updated for the current tree.
2019-11-08 06:35:40 -08:00

23 lines
391 B
Rust

use alloc::string::{String, ToString};
use thiserror::Error;
#[derive(Error, Debug)]
#[error("Wasm trap: {message}")]
pub struct Trap {
message: String,
}
impl Trap {
pub fn new(message: String) -> Trap {
Trap { message }
}
pub fn fake() -> Trap {
Trap::new("TODO trap".to_string())
}
pub fn message(&self) -> &str {
&self.message
}
}