Skip to main content

webrtc_direct_client/
error.rs

1#[derive(thiserror::Error, Debug)]
2pub enum WebRtcError {
3    #[error("browser API unavailable: {0}")]
4    BrowserApi(String),
5    #[error("js: {0}")]
6    Js(String),
7}
8impl From<JsValue> for WebRtcError {
9    fn from(val: JsValue) -> Self {
10        WebRtcError::Js(format!("{:?}", val))
11    }
12}
13
14use wasm_bindgen::prelude::*;