Skip to content

Commit

Permalink
Handle errors instead of panic
Browse files Browse the repository at this point in the history
  • Loading branch information
levidurfee committed Oct 30, 2024
1 parent 29865af commit db3f5ce
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/xb/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,14 @@ func main() {

_, err := socket.Connect()
if err != nil {
panic(err)
fmt.Printf("failed to connect to socket '%s'\n", socketPath)
return
}

reply, err := socket.Query(showProtocolsAllCMD)
if err != nil {
panic(err)
fmt.Printf("failed to query BIRD on socket '%s'\n", socketPath)
return
}

protocols := string(reply)
Expand Down

0 comments on commit db3f5ce

Please sign in to comment.