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: types/stream: change errorf to warnf #1742

Merged
merged 1 commit into from
Sep 12, 2024
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
8 changes: 4 additions & 4 deletions pkg/types/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ func (s *StandardStream) Read(ctx context.Context, conn *websocket.Conn, cancel

default:
if err := conn.SetReadDeadline(time.Now().Add(readTimeout)); err != nil {
log.WithError(err).Errorf("set read deadline error: %s", err.Error())
log.WithError(err).Errorf("unable to set read deadline: %v", err)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這個先留原本的

}

mt, message, err := conn.ReadMessage()
Expand Down Expand Up @@ -300,7 +300,7 @@ func (s *StandardStream) Read(ctx context.Context, conn *websocket.Conn, cancel
var e interface{}
e, err = s.parser(message)
if err != nil {
log.WithError(err).Errorf("websocket event parse error, message: %s", message)
log.WithError(err).Errorf("unable to parse the websocket message. err: %v, message: %s", err, message)
// emit raw message even if occurs error, because we want anything can be detected
s.EmitRawMessage(message)
continue
Expand Down Expand Up @@ -352,7 +352,7 @@ func (s *StandardStream) ping(
}

if err := conn.WriteControl(websocket.PingMessage, nil, time.Now().Add(writeTimeout)); err != nil {
log.WithError(err).Error("ping error", err)
log.WithError(err).Warnf("unable to write ws control message, ping error: %v", err)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改 Warnf

s.Reconnect()
return
}
Expand Down Expand Up @@ -439,7 +439,7 @@ func (s *StandardStream) reconnector(ctx context.Context) {

log.Warnf("re-connecting...")
if err := s.DialAndConnect(ctx); err != nil {
log.WithError(err).Errorf("re-connect error, try to reconnect later")
log.WithError(err).Warnf("re-connect error: %v, will reconnect again later...", err)

// re-emit the re-connect signal if error
s.Reconnect()
Expand Down
Loading