the whole error message

This commit is contained in:
thinkerou 2018-11-13 18:33:27 +08:00
parent 34285b75b8
commit 2860b8c79e

View File

@ -45,7 +45,7 @@ func RecoveryWithWriter(out io.Writer) HandlerFunc {
var brokenPipe bool
if ne, ok := err.(*net.OpError); ok {
if se, ok := ne.Err.(*os.SyscallError); ok {
if strings.Contains(strings.ToLower(se.Error()), "broken pipe") || strings.Contains(strings.ToLower(se.Error()), "connection reset") {
if strings.Contains(strings.ToLower(se.Error()), "broken pipe") || strings.Contains(strings.ToLower(se.Error()), "connection reset by peer") {
brokenPipe = true
}
}