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 authored and epilys committed Jul 5, 2022
1 parent 984df1e commit 220751a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Looking for changes that affect our C API? See the [C API Changelog](lib/c-api/C
## **Unreleased**

### Changed
- [#3003](https://github.com/wasmerio/wasmer/pull/3003) Remove RuntimeError::raise from public API
- [#2946](https://github.com/wasmerio/wasmer/pull/2946) Remove dylib,staticlib engines in favor of a single Universal engine
- [#2949](https://github.com/wasmerio/wasmer/pull/2949) Switch back to using custom LLVM builds on CI

Expand Down
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>) -> ! {
pub(crate) 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 220751a

Please sign in to comment.