Skip to content

Commit

Permalink
Merge pull request #72 from Alkorin/wsError
Browse files Browse the repository at this point in the history
Log HTTP response on WS connection error
  • Loading branch information
Alkorin authored Feb 12, 2019
2 parents 8af4985 + 73cf701 commit d7af0ef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mercury.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ func NewMercury(device *Device) (*Mercury, error) {
logger: log.WithField("type", "Mercury"),
}

conn, _, err := websocket.DefaultDialer.Dial(device.WebSocketUrl, nil)
conn, resp, err := websocket.DefaultDialer.Dial(device.WebSocketUrl, nil)
if err != nil {
mercury.logger.WithField("websocketResponse", resp).Trace("Failed to dial WS")
return nil, errors.Wrap(err, "failed to connect to mercury service")
}

Expand Down

0 comments on commit d7af0ef

Please sign in to comment.