impl From<anyhow::Error> for Trap (#1753)

* From<anyhow::Error> for Trap

* Add TrapReason::Error

* wasmtime: Improve Error to Trap conversion

* Remove Trap::message
This commit is contained in:
Leonardo Yvens
2020-05-29 17:24:12 -03:00
committed by GitHub
parent 8fce8ddefc
commit 0b3b9c298e
11 changed files with 74 additions and 65 deletions

View File

@@ -113,10 +113,10 @@ mod tests {
.unwrap_err()
.downcast::<Trap>()?;
assert!(
trap.message()
.starts_with("wasm trap: out of bounds memory access"),
trap.to_string()
.contains("wasm trap: out of bounds memory access"),
"bad trap message: {:?}",
trap.message()
trap.to_string()
);
}
@@ -140,8 +140,8 @@ mod tests {
.unwrap_err()
.downcast::<Trap>()?;
assert!(trap
.message()
.starts_with("wasm trap: out of bounds memory access"));
.to_string()
.contains("wasm trap: out of bounds memory access"));
}
Ok(())
}