From e6e3596e1da13f7a8b776d914af353241bb63896 Mon Sep 17 00:00:00 2001 From: thinkerou Date: Mon, 12 Nov 2018 18:06:00 +0800 Subject: [PATCH] recovery: fix issue about syscall import on google app engine --- recovery.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recovery.go b/recovery.go index e788cc47..7a7d3fa3 100644 --- a/recovery.go +++ b/recovery.go @@ -15,7 +15,7 @@ import ( "net/http/httputil" "os" "runtime" - "syscall" + "strings" "time" ) @@ -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 se.Err == syscall.EPIPE || se.Err == syscall.ECONNRESET { + if strings.Contains(se.Error(), "broken pipe") || strings.Contains(se.Error(), "connection reset") { brokenPipe = true } }