diff --git a/src/error.rs b/src/error.rs index d018b1e..1b6c925 100644 --- a/src/error.rs +++ b/src/error.rs @@ -103,6 +103,11 @@ pub enum WsErr #[ error( "Received a message that is neither ArrayBuffer, String or Blob." ) ] // UnknownDataType, + + /// Fallback whenever explicit variant hadling hansn't yet been implemented. + #[error("`{0}`")] + // + Other(String), } diff --git a/src/ws_meta.rs b/src/ws_meta.rs index 1b599ac..101874f 100644 --- a/src/ws_meta.rs +++ b/src/ws_meta.rs @@ -83,7 +83,7 @@ impl WsMeta return Err( WsErr::InvalidUrl{ supplied: url.as_ref().to_string() } ), - _ => unreachable!(), + _ => return Err(WsErr::Other(de.message())), }; } };