This commit is contained in:
Alex Emmet 2026-06-24 16:19:55 +02:00
commit 298253d6fa
31 changed files with 2899 additions and 276 deletions

17
wasm/src/error.rs Normal file
View 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())
}