File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ func receiver(
36
36
if misc .IsTemporary (err ) {
37
37
continue
38
38
}
39
- if err . Error () != "EOF" {
39
+ if ! misc . SocketClosedError ( err ) {
40
40
log .Println ("b-receive" , err )
41
41
}
42
42
return
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import (
14
14
)
15
15
16
16
func main () {
17
+ log .SetFlags (log .LstdFlags | log .Lshortfile )
17
18
frontend .LaunchAll ()
18
19
19
20
// launch debug pprof server
Original file line number Diff line number Diff line change @@ -2,7 +2,9 @@ package misc
2
2
3
3
import (
4
4
"encoding/json"
5
+ "errors"
5
6
"fmt"
7
+ "io"
6
8
"log"
7
9
"net"
8
10
)
@@ -29,3 +31,9 @@ func IsTemporary(err error) bool {
29
31
}
30
32
return false
31
33
}
34
+
35
+ func SocketClosedError (err error ) bool {
36
+ return errors .Is (err , io .EOF ) ||
37
+ errors .Is (err , io .ErrClosedPipe ) ||
38
+ errors .Is (err , net .ErrClosed )
39
+ }
You can’t perform that action at this time.
0 commit comments