Skip to content

Commit

Permalink
Added PathError check
Browse files Browse the repository at this point in the history
  • Loading branch information
dtmw89 committed Jul 24, 2024
1 parent aa8dc32 commit 0342cb9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/probe/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ func (h *Handler) Wait(interrupt chan os.Signal) error {

for i := range h.waitProbes {
err := h.waitProbes[i].Exec()
var pathErr *os.PathError
if errors.As(err, &pathErr) {
log.WithFields(log.Fields{"kind": "probe", "name": i, "err": err}).Fatal("Path does not exist!")
return nil
}
if err != nil {
log.WithFields(log.Fields{"kind": "probe", "name": i, "err": err}).Warn("not ready yet")
ready = false
Expand Down

0 comments on commit 0342cb9

Please sign in to comment.