Skip to content

Commit

Permalink
Less error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
boreq committed Nov 1, 2023
1 parent 3ec6b46 commit ab223f0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion service/adapters/relay_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@ func NewRelayConnection(address domain.RelayAddress, logger logging.Logger) *Rel
func (r *RelayConnection) Run(ctx context.Context) {
for {
if err := r.run(ctx); err != nil {
r.logger.Error().WithError(err).Message("encountered an error")
var l logging.Entry
if !errors.Is(err, websocket.ErrBadHandshake) {
l = r.logger.Error()
} else {
l = r.logger.Debug()
}

l.WithError(err).Message("encountered an error")
}

select {
Expand Down

0 comments on commit ab223f0

Please sign in to comment.