Return correct error upon websocket message read failure

This fixes variable passed as error reason upon websocker message read failure.
Previously a wrong variable was passed resulting in returning failure with nil error reason.
This commit is contained in:
Maciej Zimnoch 2025-03-07 12:53:47 +01:00
parent 1c9840c58e
commit e1d3aaf861
No known key found for this signature in database

View File

@ -312,7 +312,7 @@ func (c *wsStreamCreator) readDemuxLoop(bufferSize int, period time.Duration, de
if errRead == io.EOF {
break
}
c.closeAllStreamReaders(fmt.Errorf("read message: %w", err))
c.closeAllStreamReaders(fmt.Errorf("read message: %w", errRead))
return
}
}