Skip to content

Commit

Permalink
Return an error to close the stream if decoding an event fails
Browse files Browse the repository at this point in the history
Co-authored-by: Philip Potter <[email protected]>
  • Loading branch information
mattt and philandstuff authored Sep 19, 2024
1 parent 3676ad6 commit a200711
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ func (r *Client) streamPrediction(ctx context.Context, prediction *Prediction, l
event := SSEEvent{Type: SSETypeDefault}
if err := event.decode(b); err != nil {
errChan <- err
return err

Check failure on line 211 in stream.go

View workflow job for this annotation

GitHub Actions / build

too many return values
}

sseChan <- event
Expand Down

0 comments on commit a200711

Please sign in to comment.