WASM
This commit is contained in:
parent
ade0c3cde4
commit
298253d6fa
31 changed files with 2899 additions and 276 deletions
17
wasm/src/error.rs
Normal file
17
wasm/src/error.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
use wasm_bindgen::JsValue;
|
||||
|
||||
pub fn js_error(msg: impl Into<String>) -> JsValue {
|
||||
JsValue::from_str(&msg.into())
|
||||
}
|
||||
|
||||
pub fn from_codec_error(e: mtp_common::CodecError) -> JsValue {
|
||||
js_error(e.to_string())
|
||||
}
|
||||
|
||||
pub fn from_communication_error(e: mtp_common::CommunicationError) -> JsValue {
|
||||
js_error(e.to_string())
|
||||
}
|
||||
|
||||
pub fn from_crypto_error(e: mtp_crypto::CryptoError) -> JsValue {
|
||||
js_error(e.to_string())
|
||||
}
|
||||
Loading…
Reference in a new issue