Skip to content

Commit

Permalink
Make error messages a bit more detailed
Browse files Browse the repository at this point in the history
  • Loading branch information
cmmarslender committed Mar 16, 2024
1 parent b998da5 commit 7064263
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/websocketclient/websocketclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,11 +397,12 @@ func (c *WebsocketClient) listen() {
for {
_, message, err := c.conn.ReadMessage()
if err != nil {
log.Println(err.Error())
log.Printf("Error reading message on chia websocket: %s\n", err.Error())
if _, isCloseErr := err.(*websocket.CloseError); !isCloseErr {
log.Println("Chia websocket sent close message, attempting to close connection...")
closeConnErr := c.conn.Close()
if closeConnErr != nil {
log.Printf("Error closing connection after error: %s\n", closeConnErr.Error())
log.Printf("Error closing chia websocket connection: %s\n", closeConnErr.Error())
}
}
c.conn = nil
Expand Down

0 comments on commit 7064263

Please sign in to comment.