Skip to content

Commit

Permalink
Give access to the error that's causing a trap, not its source
Browse files Browse the repository at this point in the history
  • Loading branch information
bnjbvr committed Jun 25, 2021
1 parent e442ddc commit 377bcd9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/wasmtime/src/trap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ impl fmt::Display for Trap {
impl std::error::Error for Trap {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.inner.reason {
TrapReason::Error(e) => e.source(),
TrapReason::Error(e) => Some(e.as_ref()),
TrapReason::I32Exit(_) | TrapReason::Message(_) | TrapReason::InstructionTrap(_) => {
None
}
Expand Down

0 comments on commit 377bcd9

Please sign in to comment.