Skip to content

Commit

Permalink
Handle listener closed error gracefully (#329)
Browse files Browse the repository at this point in the history
Do not print errors for listener closing
  • Loading branch information
surki authored Feb 9, 2022
1 parent 7e75073 commit 8087be7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,11 @@ func (p *Proxy) Serve(l net.Listener) error {
continue
}

if errors.Is(err, net.ErrClosed) {
log.Debugf("martian: listener closed, returning")
return err
}

log.Errorf("martian: failed to accept: %v", err)
return err
}
Expand Down

0 comments on commit 8087be7

Please sign in to comment.