Merge 98a6a283a5e9a85ededad9485d394555e4c09537 into ecb3f7b5e2f3915bf1db240ed5eee572f8dbea36

This commit is contained in:
sleagon 2025-11-23 12:14:00 +08:00 committed by GitHub
commit b3786b74c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 *********/
/************************************/