Skip to content

Commit 91f7d08

Browse files
committed
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.
1 parent f951378 commit 91f7d08

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lighthouse-client/src/lighthouse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ impl<S> Lighthouse<S>
244244
let path: Vec<String> = path.into_iter().map(|s| s.as_ref().to_string()).collect();
245245
self.send_request(request_id, &Verb::Stream, &path, payload).await?;
246246
let stream = self.receive_streaming(request_id).await?;
247-
Ok(stream.guard({
247+
Ok(stream.map(|m| Ok(m?.check()?.decode_payload()?)).guard({
248248
// Stop the stream on drop
249249
let this = (*self).clone();
250250
move || {

0 commit comments

Comments
 (0)