mirror of
https://github.com/gin-gonic/gin.git
synced 2025-04-29 22:17:42 +08:00
Only push net error to c.Errors and panic others errors
This commit is contained in:
parent
eac2daac64
commit
cc62cdfffc
@ -924,9 +924,13 @@ func (c *Context) Render(code int, r render.Render) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err := r.Render(c.Writer); err != nil {
|
if err := r.Render(c.Writer); err != nil {
|
||||||
// Pushing error to c.Errors
|
// if err is net error, pushing error to c.Errors
|
||||||
|
if _, ok := err.(*net.OpError); ok {
|
||||||
_ = c.Error(err)
|
_ = c.Error(err)
|
||||||
c.Abort()
|
c.Abort()
|
||||||
|
} else {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user