make it fully typed and errors more verbose

This commit is contained in:
Toshit Chawda 2024-10-12 15:27:29 -07:00
parent e35717bf2c
commit 373d2f4a4d
No known key found for this signature in database
GPG key ID: 91480ED99E2B3D9D
5 changed files with 79 additions and 47 deletions

View file

@ -198,8 +198,11 @@ impl WebSocketRead for WispTransportRead {
if let Some(pkt) = obj {
let pkt =
pkt.map_err(|x| WispError::WsImplError(Box::new(EpoxyError::wisp_transport(x))))?;
let arr: ArrayBuffer = pkt.dyn_into().map_err(|_| {
WispError::WsImplError(Box::new(EpoxyError::InvalidWispTransportPacket))
let arr: ArrayBuffer = pkt.dyn_into().map_err(|x| {
WispError::WsImplError(Box::new(EpoxyError::InvalidWispTransportPacket(format!(
"{:?}",
x
))))
})?;
Ok(Frame::binary(Payload::Bytes(