Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(analytic):client closed error in windows #825

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions internal/helper/websocket_error.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package helper

import (
"strings"
"github.com/gorilla/websocket"
"github.com/pkg/errors"
"syscall"
Expand All @@ -15,6 +16,11 @@ func IsUnexpectedWebsocketError(err error) bool {
if errors.Is(err, syscall.EPIPE) {
return false
}
// client closed error: *net.OpErr
if strings.Contains(err.Error(), "An existing connection was forcibly closed by the remote host") {
return true
0xJacky marked this conversation as resolved.
Show resolved Hide resolved
}

return websocket.IsUnexpectedCloseError(err,
websocket.CloseGoingAway,
websocket.CloseNoStatusReceived,
Expand Down
Loading