From 91f7d084cfd274d96f27a1a2a6e814659db8a5aa Mon Sep 17 00:00:00 2001 From: fwcd Date: Sun, 23 Mar 2025 02:24:01 +0100 Subject: [PATCH] Fix stream error handling We need to check the response before decoding the payload to avoid trying to parse the error message into the concrete payload type. --- lighthouse-client/src/lighthouse.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lighthouse-client/src/lighthouse.rs b/lighthouse-client/src/lighthouse.rs index 992c197..db50c95 100644 --- a/lighthouse-client/src/lighthouse.rs +++ b/lighthouse-client/src/lighthouse.rs @@ -244,7 +244,7 @@ impl Lighthouse let path: Vec = path.into_iter().map(|s| s.as_ref().to_string()).collect(); self.send_request(request_id, &Verb::Stream, &path, payload).await?; let stream = self.receive_streaming(request_id).await?; - Ok(stream.guard({ + Ok(stream.map(|m| Ok(m?.check()?.decode_payload()?)).guard({ // Stop the stream on drop let this = (*self).clone(); move || {