mirror of
https://github.com/gin-gonic/gin.git
synced 2026-01-16 04:42:49 +08:00
Merge 98a6a283a5e9a85ededad9485d394555e4c09537 into fad706f1216e6d12bdd51d28d5a40ec27e6c6453
This commit is contained in:
commit
0e7ca6522b
10
context.go
10
context.go
@ -247,6 +247,16 @@ func (c *Context) AbortWithError(code int, err error) *Error {
|
||||
return c.Error(err)
|
||||
}
|
||||
|
||||
// GraceError calls `Error` internally.
|
||||
// This method does not panic when err is nil, and no return value.
|
||||
// See Context.Error() for more details.
|
||||
func (c *Context) GraceError(err error) {
|
||||
if err == nil {
|
||||
return
|
||||
}
|
||||
c.Error(err) // nolint: errcheck
|
||||
}
|
||||
|
||||
/************************************/
|
||||
/********* ERROR MANAGEMENT *********/
|
||||
/************************************/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user