mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-07 21:28:21 +00:00
Rename RuntimeError::custom to RuntimeError::user
This commit is contained in:
@@ -65,7 +65,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>) -> ! {
|
||||
let error = Self::custom(error);
|
||||
let error = Self::user(error);
|
||||
let js_error: JsValue = error.into();
|
||||
wasm_bindgen::throw_val(js_error)
|
||||
}
|
||||
@@ -74,7 +74,7 @@ impl RuntimeError {
|
||||
///
|
||||
/// This error object can be passed through Wasm frames and later retrieved
|
||||
/// using the `downcast` method.
|
||||
pub fn custom(error: Box<dyn Error + Send + Sync>) -> Self {
|
||||
pub fn user(error: Box<dyn Error + Send + Sync>) -> Self {
|
||||
match error.downcast::<Self>() {
|
||||
// The error is already a RuntimeError, we return it directly
|
||||
Ok(runtime_error) => *runtime_error,
|
||||
|
||||
Reference in New Issue
Block a user