Skip to content

Commit

Permalink
Remove RuntimeError::raise from public API
Browse files Browse the repository at this point in the history
  • Loading branch information
fschutt committed Jul 4, 2022
1 parent 14d8084 commit 6a2c7e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/api/src/js/trap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl RuntimeError {

/// Raises a custom user Error
#[deprecated(since = "2.1.1", note = "return a Result from host functions instead")]
pub fn raise(error: Box<dyn Error + Send + Sync>) -> ! {
fn raise(error: Box<dyn Error + Send + Sync>) -> ! {
let error = Self::user(error);
let js_error: JsValue = error.into();
wasm_bindgen::throw_val(js_error)
Expand Down
8 changes: 1 addition & 7 deletions lib/compiler/src/engine/trap/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use backtrace::Backtrace;
use std::error::Error;
use std::fmt;
use std::sync::Arc;
use wasmer_vm::{raise_user_trap, Trap, TrapCode};
use wasmer_vm::{Trap, TrapCode};

/// A struct representing an aborted instruction execution, with a message
/// indicating the cause.
Expand Down Expand Up @@ -106,12 +106,6 @@ impl RuntimeError {
}
}

/// Raises a custom user Error
#[deprecated(since = "2.1.1", note = "return a Result from host functions instead")]
pub fn raise(error: Box<dyn Error + Send + Sync>) -> ! {
unsafe { raise_user_trap(error) }
}

/// Creates a custom user Error.
///
/// This error object can be passed through Wasm frames and later retrieved
Expand Down

0 comments on commit 6a2c7e0

Please sign in to comment.