mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-24 19:09:57 +08:00
recovery: fix issue about syscall import on google app engine
This commit is contained in:
parent
37854ee10f
commit
e6e3596e1d
@ -15,7 +15,7 @@ import (
|
|||||||
"net/http/httputil"
|
"net/http/httputil"
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
"runtime"
|
||||||
"syscall"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ func RecoveryWithWriter(out io.Writer) HandlerFunc {
|
|||||||
var brokenPipe bool
|
var brokenPipe bool
|
||||||
if ne, ok := err.(*net.OpError); ok {
|
if ne, ok := err.(*net.OpError); ok {
|
||||||
if se, ok := ne.Err.(*os.SyscallError); 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
|
brokenPipe = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user