mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-14 20:22:20 +08:00
Merge 7aa677eb511cc5795d42914237309ebb737d31e8 into c224bf82111883dbe354edf9376642f615b7248e
This commit is contained in:
commit
eb424845f0
8
gin.go
8
gin.go
@ -327,6 +327,14 @@ func (c *Context) Fail(code int, err error) {
|
||||
c.Abort(code)
|
||||
}
|
||||
|
||||
// Dump is the same as Fail except instead of an error
|
||||
// you are able to dump out any data that you may need to
|
||||
// trouble shoot for your application.
|
||||
func (c *Context) Dump(code int, dump interface{}) {
|
||||
c.Writer.Write([]byte(fmt.Sprint("%v", dump)))
|
||||
c.Abort(code)
|
||||
}
|
||||
|
||||
func (c *Context) ErrorTyped(err error, typ uint32, meta interface{}) {
|
||||
c.Errors = append(c.Errors, errorMsg{
|
||||
Err: err.Error(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user