Skip to content

Commit

Permalink
fix: prevent cli termination on nil err on ping
Browse files Browse the repository at this point in the history
Signed-off-by: 1998-felix <[email protected]>
  • Loading branch information
felixgateru committed May 14, 2024
1 parent c265729 commit b928ae2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion coap/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,7 @@ func (c Client) Receive(path string, opts ...message.Option) (mux.Observation, e
}

func onInactive(cc *client.Conn) {
log.Fatal(cc.Ping(cc.Context()))
if err := cc.Ping(cc.Context()); err != nil {
log.Fatalf("Error pinging: %v", err)
}
}

0 comments on commit b928ae2

Please sign in to comment.