mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-04 23:16:54 +00:00
websocket: Relay disconnect errors to subscribers (#1347)
* WS: Relay disconnect errors to subscribers Subscribers probably care when the WS got disconncted. Tell them and expose a method to test the error for matching * Fix linter error
This commit is contained in:
@@ -216,7 +216,7 @@ func (w *WebsocketConnection) IsConnected() bool {
|
||||
func (w *WebsocketConnection) ReadMessage() Response {
|
||||
mType, resp, err := w.Connection.ReadMessage()
|
||||
if err != nil {
|
||||
if isDisconnectionError(err) {
|
||||
if IsDisconnectionError(err) {
|
||||
if w.setConnectedStatus(false) {
|
||||
// NOTE: When w.setConnectedStatus() returns true the underlying
|
||||
// state was changed and this infers that the connection was
|
||||
|
||||
Reference in New Issue
Block a user