mirror of
https://git.um-react.app/um/lib_um_crypto_rust.git
synced 2026-03-08 04:29:54 +00:00
build: fix wasm build
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -584,7 +584,6 @@ dependencies = [
|
|||||||
name = "umc_kuwo"
|
name = "umc_kuwo"
|
||||||
version = "0.1.9"
|
version = "0.1.9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"itertools 0.13.0",
|
"itertools 0.13.0",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
|
|||||||
@@ -1,22 +1,8 @@
|
|||||||
use wasm_bindgen::JsError;
|
use wasm_bindgen::JsError;
|
||||||
|
|
||||||
#[derive(Debug)]
|
pub fn map_js_error<T>(error: T) -> JsError
|
||||||
pub struct WasmError {
|
where
|
||||||
error: anyhow::Error,
|
T: std::fmt::Debug + std::fmt::Display,
|
||||||
}
|
{
|
||||||
|
JsError::new(error.to_string().as_str())
|
||||||
impl From<anyhow::Error> for WasmError {
|
|
||||||
fn from(err: anyhow::Error) -> WasmError {
|
|
||||||
WasmError { error: err }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl From<WasmError> for JsError {
|
|
||||||
fn from(error: WasmError) -> Self {
|
|
||||||
JsError::new(&error.error.to_string())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn map_js_error(error: anyhow::Error) -> wasm_bindgen::JsError {
|
|
||||||
JsError::new(&error.to_string())
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user