Skip to content

Commit

Permalink
refining error handling (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
DuckSoft authored Feb 18, 2021
1 parent 1aed1be commit 2c71fd9
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions dispatcher/udp/udp.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,8 @@ func (d *UDP) Listen() (err error) {
for {
n, laddr, err := d.c.ReadFrom(buf[:])
if err != nil {
switch err := err.(type) {
case *net.OpError:
if errors.Is(err.Unwrap(), net.ErrClosed) {
return nil
}
if errors.Is(err, net.ErrClosed) {
return nil
}
log.Printf("[error] ReadFrom: %v", err)
continue
Expand Down

0 comments on commit 2c71fd9

Please sign in to comment.