Merge 7aa677eb511cc5795d42914237309ebb737d31e8 into c224bf82111883dbe354edf9376642f615b7248e

This commit is contained in:
Michael 2014-07-08 16:15:28 +00:00
commit eb424845f0

8
gin.go
View File

@ -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(),