diff --git a/src/protocol/tree/endpoint.rs b/src/protocol/tree/endpoint.rs index c118d15..de678ff 100644 --- a/src/protocol/tree/endpoint.rs +++ b/src/protocol/tree/endpoint.rs @@ -353,7 +353,7 @@ impl ProtocolEndpoint { leaf_name: leaf_name.clone(), procedures: leaf.procedures.clone(), }) - .expect("serialize") + .map_err(|e| EndpointError::Frame(FrameError::Serialize(e)))? .to_vec() } else { to_bytes::(&EndpointIntrospection { @@ -366,9 +366,9 @@ impl ProtocolEndpoint { }) .collect(), }) - .expect("serialize") + .map_err(|e| EndpointError::Frame(FrameError::Serialize(e)))? .to_vec() - }; + };; let response_header = PacketHeader { packet_type: PacketType::Data,