Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove RuntimeError::raise from public API #3003

Merged
merged 1 commit into from
Jul 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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