Skip to content

Commit

Permalink
Add a way to display only the trap's reason (without the backtrace)
Browse files Browse the repository at this point in the history
  • Loading branch information
bnjbvr committed Jun 25, 2021
1 parent 7ce4604 commit c95fe67
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/wasmtime/src/trap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,11 @@ impl Trap {
}
}

/// Displays the error reason for this trap.
pub fn display_reason(&self) -> &impl fmt::Display {
&self.inner.reason
}

/// Returns a list of function frames in WebAssembly code that led to this
/// trap happening.
pub fn trace(&self) -> &[FrameInfo] {
Expand Down

0 comments on commit c95fe67

Please sign in to comment.